share
Stack OverflowBest resources to learn JavaScript
[+309] [38] Tarks
[2008-08-14 15:57:07]
[ javascript ]
[ http://stackoverflow.com/questions/11246/best-resources-to-learn-javascript ] [DELETED]

The question says it all really, I'm looking for book recommendations, video tutorials etc. I've been programming since I was about six so I don't need a book that spends 4 pages on for loops (thought that might be a Bad example [1] in terms of javascript).

Also I'm learning ASP.net at the moment so anything on interoperability features/issues would be welcome, though I'm guessing I just showed my ignorance with that question.

@the_drow - you're right, but there was no such thing when this question was posted! - Polsonby
(5) @Flubba: Then someone with privileges to do so, should do so. - the_drow
"programming since I was about six"... really? - Derek 朕會功夫
[+286] [2009-10-07 13:45:18] Skilldrick

Edit: Now that Yahoo seem to have taken down the streaming versions of the older JavaScript videos, these Crockford on JavaScript videos look to be the best resource. The other ones are available for download - I've changed the links to point to the downloads.


Here are some new videos, which go over a lot of the same material as those above, but with some talk about about the new ES5 [1], and a nice computer science history lesson, leading up to the invention of JavaScript. I highly recommend these videos - they're very informative and entertaining, and the production quality is much higher that the previous three series.

Crockford on JavaScript [2]

Volume One: The Early Years [3]

Chapter 2: And Then There Was JavaScript [4]

Act III: Function the Ultimate [5]

Episode IV: The Metamorphosis of Ajax [6]

Part V: The End of All Things [7]

Scene 6: Loopage [8]


To expand on Flubba's answer, these are Douglas Crockford's Yahoo JavaScript videos in order. (I couldn't find a list of these in order anywhere, so I thought this might help a few people out...)

They really are very good at teaching the basics, especially if you have some programming background. He does a great job of making you not hate the language.

The JavaScript Programming Language

Douglas Crockford: "The JavaScript Programming Language"/1 of 4 [9] [M4V download]

Douglas Crockford: "The JavaScript Programming Language"/2 of 4 [10] [M4V download]

Douglas Crockford: "The JavaScript Programming Language"/3 of 4 [11] [M4V download]

Douglas Crockford: "The JavaScript Programming Language"/4 of 4 [12] [M4V download]

An Inconvenient API: The Theory of the DOM

Douglas Crockford: "Theory of the DOM" (1 of 3) [13] [M4V download]

Douglas Crockford: "Theory of the DOM" (2 of 3) [14] [M4V download]

Douglas Crockford: "Theory of the DOM" (3 of 3) [15] [M4V download]

Advanced JavaScript

Douglas Crockford: "Advanced JavaScript" (1 of 3) [16] [M4V download]

Douglas Crockford: "Advanced JavaScript" (2 of 3) [17] [M4V download]

Douglas Crockford: "Advanced JavaScript" (3 of 3) [18] [M4V download]

[1] http://en.wikipedia.org/wiki/ECMAScript#ECMAScript.2C_5th_Edition
[2] http://www.yuiblog.com/crockford/
[3] http://developer.yahoo.com/yui/theater/video.php?v=crockonjs-1
[4] http://developer.yahoo.com/yui/theater/video.php?v=crockonjs-2
[5] http://developer.yahoo.com/yui/theater/video.php?v=crockonjs-3
[6] http://developer.yahoo.com/yui/theater/video.php?v=crockonjs-4
[7] http://developer.yahoo.com/yui/theater/video.php?v=crockonjs-5
[8] http://developer.yahoo.com/yui/theater/video.php?v=crockford-loopage
[9] http://yui.zenfs.com/theater/crockford-tjpl-1.m4v
[10] http://yui.zenfs.com/theater/crockford-tjpl-2.m4v
[11] http://yui.zenfs.com/theater/crockford-tjpl-3.m4v
[12] http://yui.zenfs.com/theater/crockford-tjpl-4.m4v
[13] http://yui.zenfs.com/theater/crockford-domtheory-1.m4v
[14] http://yui.zenfs.com/theater/crockford-domtheory-2.m4v
[15] http://yui.zenfs.com/theater/crockford-domtheory-3.m4v
[16] http://yui.zenfs.com/theater/crockford-advancedjavascript-1.m4v
[17] http://yui.zenfs.com/theater/crockford-advancedjavascript-2.m4v
[18] http://yui.zenfs.com/theater/crockford-advancedjavascript-3.m4v

(11) +1 for compiling this comprehensive list. - Zsolt Török
@vorushin: Thanks for the nice write-up of my blog-post :) - Skilldrick
(6) The Crockford video links are dead :( - Šime Vidas
(2) Download links still work here: developer.yahoo.com/yui/theater - Polsonby
@Šime Even the links on developer.yahoo.com/yui/theater are dead - as @Flubba said the download links work, but you can't stream them from Yahoo. They're available from third party sources, but I don't want to link to anything non-canonical. - Skilldrick
Here's the landing page which has all the Crockford videos. - Derek Gathright
+1 watching the Crockford on JS videos is what made me really 'get' the language, and more than that, get excited by it, want to learn it and really understand what it's all about. - iblamefish
It's entirely personal, but I couldn't listen to more than ten minutes of Crockford before I began twitching every time he said "um" - which is very, very frequently. I'll look for his books, but I can't listen to him. - Chap
+1 for compiling :) - chhantyal
1
[+209] [2008-08-14 16:13:54] Polsonby [ACCEPTED]

Beyond question, the best resources are the videos from Douglas Crockford of Yahoo:

http://yuiblog.com/crockford/

Also, his book - JavaScript: The Good Parts [1]

The more you know, the more you will get from these. These are not beginner introductions though even beginners will learn something.

Crockford is inspirational and extraordinarily rewarding to watch and listen to.

[1] http://rads.stackoverflow.com/amzn/click/0596517742

(15) "Crockford is inspirational and extraordinarily rewarding to watch and listen to." Absolutely. - Skilldrick
(3) Ya he aight, I guess - Pierreten
(2) the yahoo link no longer works - cmcginty
(2) @Casey - Bummer, thanks for pointing it out. You can still download the videos in M4V from here: developer.yahoo.com/yui/theater - scroll about halfway down to find the videos linked from @skilldrick's answer - Polsonby
(2) I wouldn't personally recommend his book. While it was a pleasant read, once I finished it I realized I didn't learn much from it. I had watched the videos before and most of the material in the book is already presented in the videos. - Alex Marandon
+1 for YUI Blog and Javascript: The Good Parts - chhantyal
2
[+61] [2010-05-23 18:09:56] Sidnicious

I highly recommend the free, online book Eloquent JavaScript [1] by Marijn Haverbeke.

[1] http://eloquentjavascript.net/

Totally second this. Brilliant written, modern & completely relevant. - binaryorganic
(5) It is a brilliant book indeed, but maybe not the best choice for someone that already has a background in programming. It does go back to the very basics after all... - ximi
(1) Great book with long wordy explanations for slow, patient learners, unlike myself. - clyfe
(3) Love that the book is completely available in html. eloquentjavascript.net/contents.html - jhanifen
3
[+38] [2008-08-15 15:05:58] Nickolay

For JS-the-language, A re-introduction to JavaScript [1] is a good article. It doesn't spend too much time explaining the for-loops, but it does cover the interesting features of the language.

There's also the reference and the guide [2] on JS on the Mozilla Developer Center.

If you're really looking about information on learning how to do X in the browser, you need to learn DOM apart from JavaScript-the-language itself.

[1] http://developer.mozilla.org/en/docs/A_re-introduction_to_JavaScript
[2] http://developer.mozilla.org/en/docs/JavaScript

(1) +1 for the references on MDN, I've spent countless hours there looking up APIs, it's really useful - robbles
4
[+35] [2011-07-21 09:06:05] clyfe

The quick and lazy learner
A reintroduction to JavaScript on MDN [1] lots of juice in few words, short to the point explanations
bonsaiden's Javascript Garden [2] quick walk through the really important stuff you definitely must know

The slow learner
http://eloquentjavascript.net/ - a lot of words, long and deep intuitive explanations.

The future expert
MDN Guide [3] for those who go deeper
Dmitry Soshnikov's "ECMA in detail" series [4] - see the top right "Menu" button - for the JS experts doing magic with the language

The 3 books that everyone brings up
David Flanagan, JavaScript: The Definitive Guide [5]
Crockford, Javascript the good parts [6]
J Resig, Secrets of the javascript ninja [7]
J Resig, Pro JavaScript Techniques [8]
Ok, so more like 4 but anyway.

Quirks - learn them or they will bite you
wtfjs [9] a collection of [...] irregularities

[1] https://developer.mozilla.org/en/A_re-introduction_to_JavaScript
[2] http://bonsaiden.github.com/JavaScript-Garden/
[3] https://developer.mozilla.org/en/JavaScript/Guide
[4] http://dmitrysoshnikov.com/
[5] http://oreilly.com/catalog/9780596000486
[6] http://oreilly.com/catalog/9780596517748
[7] http://jsninja.com/
[8] http://jspro.org/
[9] http://wtfjs.com/

(3) I second javascript garden, it's a great resource. - bababa
5
[+15] [2011-07-21 10:49:24] retro
6
[+10] [2011-07-21 03:48:35] user855143

In terms of interactive learning, I have been enjoying the new product that appendTo created for learning javascript. http://learn.appendto.com/

It starts from the basics and goes all the way into deep concepts.


7
[+8] [2008-08-14 16:03:00] Brian Warshaw

While some of the material might be elementary for you, Jeremy Keith's DOM Scripting is a fantastic Javascript book. Jeremy also wrote Bulletproof Ajax. While I've not read that one, I've heard good things, and I suspect that those good things are correct, given DOM Scripting.


(1) If you have more than basic programming skills, DOM Scripting is not a book that will teach you Javascript, but it will teach you how to use Javascript with HTML. Recommended. - edeverett
8
[+8] [2008-08-14 16:29:53] Theo

I'd go for Crockford's JavaScript: The Good Parts [1], it's short, concise, only talks about what matters, and focuses on how to get things done instead of showing you every single feature of the language -- actually, as the title suggests, he only shows you the good parts.

[1] http://oreilly.com/catalog/9780596517748/

9
[+7] [2008-08-14 16:07:10] Saj

You must visit: www.quirksmode.org [1]

You must read: ppk on JavaScript, Pro Javascript Techniques, JavaScript:The Definitive Guide

[1] http://www.quirksmode.org

10
[+7] [2008-09-16 14:01:17] Christopher Tokar

Before reading any other books, I only recommend Javascript: The Definitive Guide [1]. It's actually been the only book recommended by a number of experts. It's extremely thorough, covers all the nuances of the language, and is very up to date on HTTP scripting/AJAX.

[1] http://oreilly.com/catalog/9780596101992/

(2) If you're referring to the experts on comp.lang.javascript, then they barely agree on that and are constantly discussing whether any books should be recommended at all. The consensus there seems to be that while Flanagan's book is flawed, it is the least bad one around. - Tim Down
This is the book I learned from. I still have my copy from ~10 years ago! - Aaron Boodman
11
[+6] [2008-08-14 16:08:46] Vincent Robert

If you already know how to code, you will not need much to write some JavaScript. Just some study of existing code and of course, lots of practice.

For me, interesting topics were:

  • browser API, as always, learning the API is harder than learning the language, I suggest Mozilla Developer Center [1] as a reference for DOM manipulation and JavaScript internal objects ;
  • how to use that API best, study some frameworks like jQuery [2] and learn how they deal with browser inconsistencies ;
  • functional programming, lambdas and closures are smart and fun and allow a really new way of programming ( jQuery [3] uses them heavily).
[1] http://developer.mozilla.org/en/docs/Main_Page
[2] http://www.jquery.com/
[3] http://www.jquery.com/

12
[+4] [2011-03-18 22:56:55] Cincinnati Joe

The Javascript koans are supposed to be good, though I haven't personally tried them yet (love the Ruby Koans they are modeled on). This article describes how to get started with koans for three languages including Javascript: Koans Projects: JavaScript [1]

[1] http://sett.ociweb.com/sett/settJan2011.html#javascript-koans

There are a number of different JavaScript koans. I haven't tried the one that article mentions, but I worked though and enjoyed these by David Laing and Greg Malcolm. - Telemachus
13
[+3] [2008-08-14 16:00:36] Jonathan Works

Look at the source code of jQuery or some other framework. Javascript is a very powerful language if you know how to use it properly, and learning from others is the way to go.


14
[+3] [2008-08-15 15:39:25] Seibar

There is a new startup called AppJet that sets out to teach people how to program.

http://appjet.com/


Your link says: Google has acquired AppJet Inc. and its EtherPad collaboration product and technology. The EtherPad.com servers have now been shut down, according to the timetable announced previously. Google recognizes the value of the EtherPad code base and has released the code as open source. - mentat
15
[+3] [2008-08-15 16:04:44] jeremiahd

I second the recommendation of Douglas Crockfords videos. I haven't read his book, but judging from the quality of his other writings on javascript [1], I would assume that it is worth reading.

I personally found Javascript: The Definitive Guide [2] to be of great help while I was learning my way around javascript.

[1] http://javascript.crockford.com/
[2] http://oreilly.com/catalog/9780596101992/

16
[+3] [2011-07-21 04:30:06] Jason Gritman

Essential JavaScript Design Patterns For Beginners [1] is a good place to go once you have the basic syntax down. It can be read within a few hours too. Warning, there is a very lengthy exposition on patterns in general before you get to the JavaScripty stuff.

[1] http://addyosmani.com/resources/essentialjsdesignpatterns/book/

17
[+3] [2011-07-21 16:09:43] chetan

Try JS Info [1], not only JS others technologies are also present which are helpful

[1] http://javascript.info/

18
[+2] [2009-02-28 14:03:35] elmarco

Douglas Crockford on video again in a great google talk [1] February 27, 2009,

[1] http://www.youtube.com/watch?v=hQVTIJBZook

19
[+2] [2011-03-07 14:22:32] Bruno Rohée

Can't believe that the comp.lang.javascript FAQ [1] didn't get posted earlier. It's quite a nice resource, and linking many others, including the normative documents.

[1] http://www.jibbering.com/faq/

20
[+2] [2011-07-21 12:18:18] ajr

As an experienced C programmer needing to 'convert' myself to JavaScript, I found the book 'Professional JavaScript for Web Developers' by Zacas (ISBN 978-0-470-22780-0) very helpful. But I found that no one resource was enough on its own. If you're a book-oriented person you'll probably end up with 2 or more books.

One catch for experienced programmers is that many/most JS books include elementary stuff about programming that will be a waste of time for you. I've found it really frustrating trying to find learning resources aimed at the experienced programmer. Before buying a book, look on the publisher's website & see if you can download free sample chapters to get a flavour.

As soon as you've got the basics, it'll be useful for you to learn about jQuery, for which an excellent book is 'jQuery In Action' by Bibeault and Katz (ISBN 978-1-935182-32-0). It's worth pointing out that the appendix, called 'JavaScript that you need to know but might not' is, in itself, an excellent introduction to JS for experienced programmers.

Some useful links:
JavaScript for C & Python programmers [1]
Learning JavaScript from PHP - a Comparison [2]

BTW one learning technique I found useful was to write notes in the form of a 2-column table, comparing features of a language I knew already (C) with analogous features in JavaScript. I ended up doing the same for PHP. If I ever get round to setting up my own website I might post these documents on it.

[1] http://www.wooji-juice.com/blog/javascript-article.html
[2] http://www.lullabot.com/articles/learning-javascript-php-comparison

21
[+2] [2011-07-21 14:28:02] chernevik

I am but an egg, but . . .

I really like "Test Driven JavaScript Development" by Chris Johansen. It's a midlevel book that requires some prior knowledge of JavaScript and maybe some familiarity with TDD. But it provides an excellent discussion of TDD as a tool for exploring a new language. It walks through some of the core JavaScript principles and their implications for program (and framework) design. It walks through several examples of test driven development, touching on minimal code to pass, stubbing, refactoring, test code refactoring.

The style balances discussion of principle and elaboration of detail nicely. At times I might wish for a little more, but then again figuring this stuff out is part of the game.

I came away from this with a much better grasp of JavaScript, development process, and design principles generally. I don't think I've gotten more from any single book.

The question comes from an experienced coder, who might not need these exposures, but maybe others will.


22
[+2] [2011-07-23 01:28:34] chrixian

I learned quite a bit by going through the "Let's Make a Framework" series on DailyJS [1].

[1] http://dailyjs.com/tags.html#lmaf

23
[+2] [2011-08-23 02:35:23] Kirk Broadhurst

Hate to add more guff when there are so many existing answers, but http://www.codecademy.com is too good to ignore. A hand-held, interactive, web based learning tool for JavaScript. I'd give it to my non-programmer friends as well as my non-JavaScript programmer friends. It's excellent.


Also check out a new site with a similar approach, that might be even better... codeavengers.com - Mike
24
[+1] [2011-09-28 09:03:35] Iain Cooke

Note that the crockford lecture links have been changed. It looks as though Yahoo have consolidated the 4 separate sessions into one long video. It took me a while to find them because the web is full of the old (now broken) links, so to be helpful, here are the new ones:

Douglas Crockford — The JavaScript Programming Language (episodes 1-4 I think) http://yuilibrary.com/theater/douglas-crockford/crockford-tjpl/

Douglas Crockford — An Inconvenient API: The Theory of the DOM http://yuilibrary.com/theater/douglas-crockford/crockford-domtheory/


25
[+1] [2011-10-28 22:55:26] Peter Tseng

Codecademy is interactive - it's pretty sweet: http://www.codecademy.com/


26
[+1] [2011-11-07 19:21:52] Knarf
27
[+1] [2011-11-19 01:14:05] chhantyal

Has anyone tried this little gem Head First HTML5 Programming:Building Web Apps with JavaScript [1] ? It is by far the best book I have ever seen for newbie front-end developer. Yes, it is HTML5 book, but you are taught Javascript before HTML5. It goes on to introduce Javascript as foundation. Then it shows all the magic combining HTML5 and Javascript.

[1] http://rads.stackoverflow.com/amzn/click/1449390544

28
[0] [2008-08-14 16:03:30] Chris Tybur

I recommend Danny Goodman's book JavaScript Bible. I have the 4th edition, though a think the 5th is the current one. It's very comprehensive, and most chapters have exercises at the end. It's been a very useful resource.


29
[0] [2008-08-14 16:09:24] Thomas Owens

JavaScript Bible is indeed in it's 5th Edition. In addition, JavaScript: The Complete Reference is a good book. Although they are references, I used them to learn the language.


30
[0] [2008-08-14 16:26:07] jammycakes
  • DevGuru [1] is a good reference site for core JavaScript functions etc.
  • Once you're familiar with the basics, I heartily recommend John Resig's book Pro JavaScript Techniques [2] for the more advanced stuff.

I originally recommended W3schools [3] in this answer, but following a comment below I've decided to retract that recommendation. I do have some reservations of my own about W3schools -- for example, their PHP tutorial [4] teaches you to create SQL statements by naively smashing strings together -- a bad, bad practice that will leave your website riddled with elementary security holes.

[1] http://devguru.com/technologies/javascript/home.asp
[2] http://rads.stackoverflow.com/amzn/click/1590597273
[3] http://www.w3schools.com/JS/default.asp
[4] http://www.w3schools.com/php/php_mysql_insert.asp

(2) Please don't recommend w3schols — their site contains errors they don't care to correct and they refuse to admit they aren't affiliated with w3c. The problem is explained in detail on w3fools. - Kornel
Point noted -- answer updatead accordingly. - jammycakes
31
[0] [2009-03-14 15:12:00] Gulzar Nazim

If you want to learn little bit more than the typical 'HOW TO DO' samples and Javascript reference material available on web, you should really check out Javascript articles by Douglas Crockford [1]..

[1] http://www.crockford.com/

32
[0] [2011-04-13 11:04:38] Neil

Jeffrey Way's Javascript from Null [1] video series on NetTuts+ [2] is a nice an easy introduction if you are more a visual learner like me.

[1] http://net.tutsplus.com/tutorials/javascript-ajax/javascript-from-null-video-series/
[2] http://net.tutsplus.com

33
[0] [2011-07-19 21:31:26] Mark Lassoff

Here is a pretty good video Javascript Training Course [1]. It's great for beginners, but probably not great for someone who already has a programming background. It teaches the basics in an understandable way.

[1] http://www.learntoprogram.tv/javascript-training-course/

34
[0] [2011-07-21 05:31:09] Xah Lee

for those who already knew several scripting languages well, may i introduce my little tutorial? http://xahlee.org/js/js.html covers the basics, very short. Gets you started quick.


35
[0] [2011-07-21 06:01:05] 32423hjh32423

I would like to suggest anything by this guy http://peter.michaux.ca/

Not so much a place to start or that structured but his articles are well written and cover some awesome topics.


36
[0] [2011-07-24 12:40:55] Ahmad Ajmi

Here is a the best videos ontwik.com/javascript [1]

JavaScript Patterns by Stoyan Stefanov

[1] http://ontwik.com/category/javascript/

37
[-10] [2008-08-14 16:15:46] farmerchris

I'd start with the JavaScript tutorial [1] at w3schools. When looking something up in Google, I often tack "w3schools" onto the search string for a quick overview.

[1] http://www.w3schools.com/JS/default.asp

(4) w3schools is like a time machine - they should change their tagline to 'welcome to 2004' - timoxley
(4) I'v always tried to avoid that resource. I'v never understood why many suggest w3schools. As i was learning web technologies, it was not easy to learn and understand resource for me. More like a reference not a tutorial. - Janis Veinbergs
38