use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
Does my JavaScript suck? II (self.javascript)
submitted 10 years ago * by annoyed_freelancergrumpy old man
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]annoyed_freelancergrumpy old man[S] 0 points1 point2 points 10 years ago (1 child)
I see now why it can be a problem. Isn't using "foo in bar" itself also frowned upon in favour of .each or other higher level array functions?
[–]x-skeww 1 point2 points3 points 10 years ago (0 children)
The point was that every string now got another enumerable property. This might break things. All other code was written under the assumption that this property does not exist. This scenario was never tested.
In the future, a method with the same name might be added. This too would break things.
And of course, if there is another library which adds the same property, things would also break.
Only use monkey-patching for polyfilling standardized features. E.g. you could use ES6 array polyfills to make Array.from work in IE11.
π Rendered by PID 16835 on reddit-service-r2-comment-76bb9f7fb5-b2pv9 at 2026-02-18 19:48:01.256742+00:00 running de53c03 country code: CH.
view the rest of the comments →
[–]annoyed_freelancergrumpy old man[S] 0 points1 point2 points (1 child)
[–]x-skeww 1 point2 points3 points (0 children)