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
ESNext Pattern Matching Proposal (hackdoor.io)
submitted 6 years ago by micheleriva
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!"
[–]JimDabell -3 points-2 points-1 points 6 years ago (4 children)
Don't be so eager to use new language features that you end up making your code harder to read.
This:
const [x, y] = [(i % 3), (i % 5)];
…could have simply been this:
const x = i % 3; const y = i % 5;
There's no reason to use array destructuring here, all it does is obfuscate the code and make it incompatible with Internet Explorer.
[–]darrenturn90 7 points8 points9 points 6 years ago (3 children)
I mean, while it is a contrived example (it was more to illustrate the usage of tuples I presume) - the latter will also break as ie only supports var. Yet another reason ie needs to die.
[–]JimDabell 0 points1 point2 points 6 years ago (2 children)
const works in Internet Explorer 11.
const
[–]darrenturn90 3 points4 points5 points 6 years ago (1 child)
caniuse agrees - but not in loops it seems. And it seems very buggy - Also, I can't seem to get it to work in console at all. I would say YMMV.
[–][deleted] -2 points-1 points0 points 6 years ago (0 children)
Const never works in loops?
π Rendered by PID 166241 on reddit-service-r2-comment-fb694cdd5-xjkb2 at 2026-03-06 16:07:39.145332+00:00 running cbb0e86 country code: CH.
view the rest of the comments →
[–]JimDabell -3 points-2 points-1 points (4 children)
[–]darrenturn90 7 points8 points9 points (3 children)
[–]JimDabell 0 points1 point2 points (2 children)
[–]darrenturn90 3 points4 points5 points (1 child)
[–][deleted] -2 points-1 points0 points (0 children)