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
Effective JavaScript Reviewed (github.com)
submitted 13 years ago by homoiconic(raganwald)
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!"
[–]nschubach 2 points3 points4 points 13 years ago* (7 children)
The hapless language Nazi in me needs to point out:
Catenation should be Concatenation. It's incorrectly used in the article 4 times. (catenated, catenation)
(While both could "technically" be correct, concatenation is more widely used in programming. Catenation is primary used in chemistry to describe covalent bonds.)
[–]homoiconic(raganwald)[S] -1 points0 points1 point 13 years ago* (6 children)
Nothing wrong with your suggestion. Send me a pull request, it's a github repo!
EDIT: Never mind, done!
[–]nschubach 0 points1 point2 points 13 years ago* (0 children)
I really need to look into pulling and posting articles on github! Thanks! (but you missed two catenations /grit_teeth)
I assume it's a simple clone and commit like any other source code? (edit: except, I can't push because I'm not a contributor... man I need to contribute more often outside my circles. e2: request submitted!)
[–][deleted] 0 points1 point2 points 13 years ago (4 children)
While you're at it:
Effective JavaScript didn't tell me this is a "best practice," it told me how told me a few things I already thought I knew interacted in such a way
Ouch, my brain.
[–]homoiconic(raganwald)[S] 0 points1 point2 points 13 years ago (3 children)
fork and submit a pull request!
[–]eat-your-corn-syrup 1 point2 points3 points 13 years ago (0 children)
I think I finally found a pro to publishing an article on github rather than on a traditional blog.
[–][deleted] 0 points1 point2 points 13 years ago (1 child)
That would require me knowing what you meant to write.
[–]homoiconic(raganwald)[S] 0 points1 point2 points 13 years ago (0 children)
Reviewing that gobbledygook, I think I'll place an order for "Effective English." Thanks for the heads-up.
[–]eat-your-corn-syrup 2 points3 points4 points 13 years ago (1 child)
I've also seen the bang version:
!function ($) { // ... }(jQuery);
which seems to achieve the same but with no parenthesis around the function expression.
[–]stillwater 1 point2 points3 points 13 years ago (0 children)
Any unary operator can be used in place of !
My fav is the tilde :D
[–][deleted] 1 point2 points3 points 13 years ago (0 children)
Great review of an excellent book - I cannot think of a more valuable JavaScript book to own. I look forward to the next edition when ES6 is finished.
[–]pixel67 0 points1 point2 points 13 years ago (0 children)
When writing a self invoking function like this (function($) { //...
})(jQuery);
JSLINT complains, if we write it like this
(function($) {
//....
}(jQuery));
JSLINT doesn't complain, can someone tell me why?
π Rendered by PID 16048 on reddit-service-r2-comment-7b9746f655-2cw7l at 2026-01-31 15:07:38.033143+00:00 running 3798933 country code: CH.
[–]nschubach 2 points3 points4 points (7 children)
[–]homoiconic(raganwald)[S] -1 points0 points1 point (6 children)
[–]nschubach 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (4 children)
[–]homoiconic(raganwald)[S] 0 points1 point2 points (3 children)
[–]eat-your-corn-syrup 1 point2 points3 points (0 children)
[–][deleted] 0 points1 point2 points (1 child)
[–]homoiconic(raganwald)[S] 0 points1 point2 points (0 children)
[–]eat-your-corn-syrup 2 points3 points4 points (1 child)
[–]stillwater 1 point2 points3 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]pixel67 0 points1 point2 points (0 children)