I personally prefer programming guides with some humor, lots of examples and exercises. That's why I recommend Eloquent Javascript by Marijn Haverbeke.<p><a href="http://eloquentjavascript.net/" rel="nofollow">http://eloquentjavascript.net/</a>
The best way I've found to learn JavaScript is through anything by Douglas Crawford. 'JavaScript the Good Parts' is especially good.<p><a href="http://oreilly.com/catalog/9780596517748" rel="nofollow">http://oreilly.com/catalog/9780596517748</a>
<a href="http://www.youtube.com/watch?v=hQVTIJBZook" rel="nofollow">http://www.youtube.com/watch?v=hQVTIJBZook</a>
Is this the same Mozilla JS reference that's been kicking around for ages? I know there seems to be a big campaign to promote JS resources at the moment, but surely everyone on HN would know about this if they have more than a passing interest in Javascript or learning it...
I do like the content of MDC, but it can be frustrating at times, as it seems to have broken links (links that go to pages which have had their content merged into a different page).<p>Or apparently, on the Processing XML with E4X page, there are errors in the page: /content/body/div[2]/pre[1]/@function, reference to undefined name 'syntax': line 1, column 1 where every code sample should be.<p>It's under a CC license, so I am hoping that someone will make a better interface for the content some day.
This used to be my sole resource for everything javascript, it is actually very good still but there's a slight catch; beware cross browser compatibility issues, especially with IE, especially especially with older versions of IE.
While we are at it, perhaps somebody could explain this JS gotcha I recently ran into?<p>My goal was to return something like {x:1} (an object) from a script. It never worked. If I type that into a console, it returns "1". If I type x:1 into the console, it also returns 1. So I guess the "{}" is just interpreted as a block, returning the value of the x:1 expression. But what does x:1 mean? I am guessing it might just be a bug in the interpreter? Or when is something an object, and when just a block? var a = x:1 doesn't work, btw. this.x is also still undefined after this.<p>The only way I could return my wanted object was by doing var y = {x:1};y;<p>(This was supposed to be the return value of a Script in NodeJS, using these silly values because it was a unit test).