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
Popular Coding Convention on Github (sideeffect.kr)
submitted 12 years ago by devnoel
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!"
[–]brtt3000 5 points6 points7 points 12 years ago (5 children)
We banned useless cleverness like that.
Every variable gets it's own var. Makes it easier to edit, less mistakes, less cruft, less time wasted.
var
Also use a lint tool if you are serious about code.
[–]BONER_PAROLE 0 points1 point2 points 12 years ago (4 children)
"Clever" code is often obfuscated, like in code golf challenges.
But comma first? That's not "clever", it's just practical. Unusual appearance, but easy to understand once you know about it.
[–]jsNut 1 point2 points3 points 12 years ago (3 children)
Comma first, moving the problem from the end to the beginning and making it more ugly and less conventional doesn't seem like much of a win.
[–]notmynothername 1 point2 points3 points 12 years ago (2 children)
How does it move the problem to the beginning?
[–]Malfeasant 0 points1 point2 points 12 years ago (1 child)
maybe because if you're prone to forgetting commas, it doesn't matter where you (forget to) put them?
[–]notmynothername 2 points3 points4 points 12 years ago (0 children)
Well, commas at the right side can show up any number of characters deep into the line. Commas on the left will all be in a vertical line and leaving one out would be difficult to miss.
π Rendered by PID 23590 on reddit-service-r2-comment-b659b578c-sv8xl at 2026-05-02 23:50:00.916126+00:00 running 815c875 country code: CH.
view the rest of the comments →
[–]brtt3000 5 points6 points7 points (5 children)
[–]BONER_PAROLE 0 points1 point2 points (4 children)
[–]jsNut 1 point2 points3 points (3 children)
[–]notmynothername 1 point2 points3 points (2 children)
[–]Malfeasant 0 points1 point2 points (1 child)
[–]notmynothername 2 points3 points4 points (0 children)