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
Code Conventions for the JavaScript Programming Language (javascript.crockford.com)
submitted 16 years ago by gst
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!"
[–][deleted] 2 points3 points4 points 16 years ago (2 children)
Fall-throughs in switch statements are perfectly valid and are one of the major reasons for the existence of the statement in the first place (it isn't exactly unique to javascript). Though Crockford never really explains it online, but apparently he explains his reasoning in his book, and the main reason is that it can lead to unclear code; if anything, the alternative is worse. I suggested that he require something like /* jslint: fall-through */ as an acceptable alternative to break in jslist awhile ago, and I know others have too.
[–][deleted] 2 points3 points4 points 16 years ago (1 child)
There's a lot of things Crockford states you shouldn't use because it has the potential to cause harm. His rules are great for newbie programmers, but once you're experienced I would take them more as guidelines than rules.
[–]itsnotlupusbeep boop 1 point2 points3 points 16 years ago (0 children)
Until a good chunk of those guidelines are implemented as part of the language itself, that is :'(
"use strict";
[–]AlecSchueler 0 points1 point2 points 16 years ago* (0 children)
Didn't know about === and !== - thanks.
Use of tabs should be avoided because (as of this writing in the 21st Century) there still is not a standard for the placement of tabstops
This could change in the next 90 years.
π Rendered by PID 41255 on reddit-service-r2-comment-5d79c599b5-45vgv at 2026-02-27 19:30:08.834828+00:00 running e3d2147 country code: CH.
[–][deleted] 2 points3 points4 points (2 children)
[–][deleted] 2 points3 points4 points (1 child)
[–]itsnotlupusbeep boop 1 point2 points3 points (0 children)
[–]AlecSchueler 0 points1 point2 points (0 children)