-
Notifications
You must be signed in to change notification settings - Fork 22.7k
Improve .forEach examples: syntax and consistency #12799
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Preview URLsFlawsNone! 🎉 External URLsURL: No new external URLs (this comment was updated 2022-02-07 21:15:23.935225) |
I think |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! These generally seem like good improvements but I had a couple of suggestions.
files/en-us/web/javascript/reference/global_objects/array/foreach/index.md
Outdated
Show resolved
Hide resolved
|
||
if (this == null) { throw new TypeError('Array.prototype.forEach called on null or undefined'); } | ||
|
||
if (this === null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should delete this whole "Polyfill" section. We already link to a polyfill in "See also" and we have a general consensus that we don't want to embed polyfills in MDN pages: openwebdocs/project#27.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed in separate commit, just don't cherry-pick it on landing it it should be a separate PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 thank you @tshemsedinov !
Summary
var
andlet
toconst
where possible==
instead of===
Motivation
To refresh code examples before making changes to the article itself.
Metadata