Learning javascript [closed]
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this questionCurrently, I am using Javascript - The Definitive Guide for learning Javascript from scratch. Having learnt Java, PERL and other programming languages, I am in a habit of solving small exercises to check/better understand what I have been learning as well. In case of Javascript, I found the book to be severely lacking in exercises. 开发者_开发问答Infact, I did not find exercises in the only other book [ Beginning Javascript ] I have either.
Is there any source that I can refer to for exercises in Javascript?
Once you get a good grasp on the syntax, Crockford has a page that compares javascript with Scheme and takes you through a short book The Little Schemer. The article is appropriately named The Little JavaScripter.
After reading the book, I was changed. Or perhaps transformed. Or altered. In a good way. There are very few books that deeply change the way that you think. This is one of those books.
He's gone through the chapters and translated the functions into javascript. As an exercise, you could do the same and compare your solutions.
I learned Ruby using Ruby koans, and they are an awesome way to learn any language. There is a set of Javascript koans.
Try them for a day or two, use it if you like it.
I would suggest reading everything Douglas Crockford has to say about JavaScript, reading The Good Parts, writing as many programs as possible and running them all through JSLint with "the Good Parts" and rewriting them until it stops complaining, and reading the source of jQuery. It also wouldn't hurt to read Dmitry A. Soshnikos' rendition of the ECMA-262 spec. (It's very specific and goes into minute detail but it also covers every possible aspect of the language)
It would probably be good to mention that you don't need to follow Crockford's conventions to the letter if you don't want to (though I would recommend writing for ES5 strict) but limiting yourself to them while you learn the language is definitely the way to go.
Check developer.mozilla.org
I'd try out http://www.codecademy.com/ They are fairly new, and offer a nice step by step lessons that require bits of code for each step. They have some nice challenges too (build a cash register, build a blackjack game). The forums are extremely helpful as well. Best place I've found to learn javascript.
I have checked out so many guides online and came to these conclusions:
Check out Codeacademy for the basics. After you're finished there, go to javascript.info - this guide covers a LOT and is very detailed and well explained, with exercises.
i used http://w3schools.com/js when i first learnt JS - they have a functional but far from great 'try it yourself' editor to modify their examples, not quite the same as exercises but may give you the same benefit (fiddling to better understand)
精彩评论