By the time the author writes it, it's published, and you read it, the information can be dated, sometimes extremely so.
There are gobs of online resources, and the best resource is rarely mentioned: reading other peoples code.
Once you get a basic understanding, you can start right clicking on webpages, "inspect source", opening the console window, and looking at how pages actually work. The debugger and single stepping chrome are quite good.
Also there are many books online which don't need to go through the hoops you describe.
I agree that there are many books online though, and they can provide a lot of nice things like running code samples in your browser. However, I find video tutorials to provide a better experience than books, online or not. I suppose that's just a matter of personal preference though.
However Javascript (in its current ES7 version) is a pretty good language.
That being said, there are some pretty fundamental abstract concepts behind all forms of programming that have stuck around for a long time: those old comp sci course materials. I'd recommend turning to books for some of that content, as picking up some knowledge there will support you no matter what programming language you try to learn.
Having said that it is a good idea to learn about these early and keep them in mind. Sadly there isn't a good definitive list of JS' idiosyncrasy that I know of.
If you're doing front-end work, then React and Redux (or Angular, or jQuery, or whatever.)
If you're doing Node.js, try reading through the lib/ folder of Node's source (the js code goes in lib/, the c++ goes in src/), and follow that with packages like express and request.
When you hit an interesting/confusing/etc. dependency, track it down and read it's source too.
Suffice to say once I hit that section I went back to codeacademy finished the course (which never brought them up and I'm not sure if that's good or bad) now I'm back in Eloquent Javascript...it get's really hard really fast.
It is available for free on github so you can evaluate before buying.
I wish more authors would publish the markdown or asciidoc. I'd pay for it.
And, although the book is dated, I think it still does a good job of explaining the core concepts of the language even of today.
For an absolute beginner, JavaScript and jQuery by Jon Duckett is extremely accessible. Sure, it covers jQuery but it's so well aimed at total beginners it's not a bad path.
At the lower intermediate level, Eloquent JavaScript (mentioned elsewhere) is fantastic.
At higher levels/if you know other languages and are comfortable learning new ones: Effective JavaScript, YDKJS, and Speaking JavaScript all fantastic and complement each other in various ways.
Obviously, this will more teach you how to write good code that happens to be in Javascript, rather than taking an already-solid programmer and showing them the nitpicky details, idiosyncrasies, and browser APIs of Javascript.
https://github.com/MostlyAdequate/mostly-adequate-guide/pull...
- Secrets of the JavaScript Ninja by John Resig (my favorite)
- Eloquent JavaScript by Marijn Haverbeke
No waiting for your code to be processed server side, or anything like that. I pick up a book later on, commonly, if I know the language and want to know more about techniques for building something specific with it.
But for learning a new language, an editor and a hello world app are where I start.
Are you looking to learn code via JS?
Are you proficient in another language that has similar constructs to JS and just need to understand the nuances?
Are you somebody who has understood JQuery on a low level but never understood what the code was actually doing?
I am sure there are a few more questions along similar veins and I think each one of these questions could be interpreted from the OP and I think all of these have potentially different answers.
Lately I just turn to intercooler, but that's not a solution for everything.
For developers, I'd recommend Kyle Simpson's "You Don't Know JS" books, in particular "This & Object Prototypes", followed by "Scopes & Closures". Well written, with plenty of example code, these are deep dives into specific areas which make Javascript different/weird. They're available to read in his Github repo (https://github.com/getify/You-Dont-Know-JS), but consider buying them, as he deserves to get paid.
- You have to start with ECMA5. 95% of new features in later versions can be transpiled back to it, and examining resulting code is usually the easiest way to comprehend them. Oh, how many candidates I've seen that talk about 'modern classes' with a flare and then can't explain prototypical inheritance at all. So, the best start is "JavaScript: The Definitive Guide, 6th Edition".
- Be very careful about what you read online. Blog platforms are full of script kiddies trying to feed you their misconceptions without a second thought. I generally only 'trust' two sources - Mozilla Developer Network and http://2ality.com/ by Axel Rauschmayer (I believe his books are mentioned in other answers too).
- Whenever you are faced with a particular library/technology - look from books/posts from their creators or someone associated with them.
Previous versions of Javascript make JS a mediocre language, while ES2016 makes it a pretty good and powerful one. So try to look for a tutorial that is very recent and focused on the latest javascript idioms.
I think that if you already know how to program in at least one of the following languages: C++/C#/Java/Python, you will learn Javascript in no time, no need for a book, to be honest.
Javascript is a very simple language, my recommendation would be to start as follows: 1. First learn how to create a JSON (javascript object notation) object 2. Then understand how to define a function (better if you do it the ES6 way, that is, using the "=>" operator), and how to call it. 3. Learn how to use lists and hashtables(dictionaries). 4. After this, learn how to use JSON objects, that is, how to access each member of a JSON object. This will be trivial after step (3). 5. Then, learn the simple logic constructs: if, for, etc. They are easy, really.
Now comes the slightly more difficult part. I'm assuming you want to try Node.js development.
6. Learn what is the Node.js "event loop". IN other words, the philosophy behind Node and why most operations are "asynchronous" in Node.js. Learn about callbacks. 7. Now learn about "Promises" and learn how to use "async" and "await" to consume Promises easily. In other words, to program using asynchronous functions with no sweat. 8. Learn "express.js" web framework. It is really easy.
And don't forget to take a look to the ES6 and ES7 features and make sure you take advantage of them:
If you want to learn concepts, You Don't Know JS by Kyle Simpson is great.
If you want to learn by doing, I would look away from books & more towards video based learning. It seems to have richer content in this style. Pluralsight, Frontend Masters, Egghead & Code School are all great. They also target different niches. If you're a complete beginner I suggest Code School. It does the best out of those at telling you where to start & what to learn next.
https://github.com/getify/You-Dont-Know-JS/tree/master/scope...
javascript : good parts - https://www.amazon.com/JavaScript-Good-Parts-Douglas-Crockfo...
Disclaimer: I am the author of the book
It only focuses on the concepts that make Javascript different from (let's say) Java.
Note: this is a pre-ES6 book.
[1]: http://www.javascriptenlightenment.com/JavaScript_Enlightenm...
JavaScript Patterns / Build Better Applications with Coding and Design Patterns / By Stoyan Stefanov
I remember really hating the tutorial on 'How to use APIs with Javascript', for example. It basically told me exactly what to type in and I 'passed' the course without understanding any of it.
Also; JavaScript the good parts
* Speaking JavaScript
* Exploring ES6
* Exploring ES2016 and ES2017