Ask HN: Best current book to learn JavaScript? - babyboy808
======
payne92
And anti-answer: consider learning JavaScript from something other than a
book. The publication cycle for conventional box is relatively long, relative
to the pace of technology evolution.

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.

~~~
NathanCH
Agree with most of your answer but your last point is pretty optimistic.
Nowadays most Javascript is a bundled package of 100 minified npm modules.

Also there are many books online which don't need to go through the hoops you
describe.

~~~
jamescostian
If you visit a website owned by a company you're probably right. If you visit
a little demo (like the type of thing someone would hack up in a day and put
up on show HN) you'd be surprised by how much investigation you can do.

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.

------
peterchon
Eloquent javascript is also fantastic.
[http://eloquentjavascript.net/](http://eloquentjavascript.net/)

~~~
cdumler
My go to for people new to JS.

~~~
old_chap
I'm learning Javascript. I can safely say im comfortable with most fundemental
programming concepts...then the book starts talking about recursive functions.

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.

~~~
fencepost
Not having any real experience with JS programming, is this talking about
privately named functions (e.g. var MyFunction = function MyHiddenName
(blah){}) or was this not being familiar with recursion? Or is there something
else funky in JS that I just don't know about?

~~~
appleiigs
He's talking about recursion - a function calling itself. I find it's funny
that factorials are understood easily in high school, but then recursion is
mind blowing in front of a computer. Just like factorials, it can be
understood best by walking through it with paper and pencil.

The examples in Eloquent Javascript need to be studied by the reader to get
the most out of that book. I think people just glance at them with out typing
them up and running them.

------
sharmi
You don't know JS is a good book to start with and explains ES6 too.

It is available for free on github so you can evaluate before buying.

[https://github.com/getify/You-Dont-Know-JS](https://github.com/getify/You-
Dont-Know-JS)

~~~
spraak
I think this is more for someone already familiar with the foundation level
than for a beginner

~~~
johnfn
The irony of a book called "You Don't Know JS" not in fact intended for people
who don't know JS. :)

~~~
tashoecraft
Idk, I always interpreted it as a conversation, where you the reader are
saying "I know javascript" and Kyle Simpson says that you don't, which is how
the book is intended.

~~~
abraves10001
I've taken a few of his online courses and he does an excellent job telling
someone they don't know js, without coming off arrogant. I think it's mostly
because he can explain most issues in depth but as a previous comment pointed
out, it isn't really a beginner series. Although, I am not sure "[learning]
javascript" necessarily means that the learner is completely inexperienced.

------
fredophile
I found JavaScript: The Good Parts useful. It's very short and gets right to
the point. The author focuses on the parts of the language people tend to use
every day and highlights some gotchas and common mistakes that you might not
expect (like == vs ===) if you're coming in from other languages.

~~~
ameliaquining
One warning: Although it's a good book, it was published in 2008 and a lot has
been added to the language since then. It will give you a solid understanding
of the core of the language, but for modern best practices you'll have to look
elsewhere.

~~~
dhimes
Where would you suggest?

~~~
jensvdh
MDN.

~~~
jensv
Hello there jensvdh, pleased to make your acquaintance.

~~~
jensvdh
Always a pleasure to meet a fellow Jens!

------
petercooper
Depends on what your level is going in.

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.

------
aarpmcgee
[https://leanpub.com/javascriptallongesix](https://leanpub.com/javascriptallongesix)

~~~
vqc
everything by Reg “raganwald” Braithwaite is fantastic

~~~
lists
I've never seen anyone use a POJO like this guy

------
tbirrell
The problem with this question is by the time I finish typing my answer, the
JS world will have moved on to the next big thing

~~~
veidelis
Yes, React will be baked into the browser, wasm will be supported widely and
everyone will write JS in their favorite language. Not to mention JS will have
threads.

~~~
devNoise
I've been going through the challenges and projects at freeCodeCamp to shore
up my JS skills. I had been using React and started to focus on the D3.js
projects. Started a new project with React and now I'm being told that
React.createClass is being deprecated in v16. JS the language is getting
better and more powerful. The frameworks and the libraries are a moving
target.

------
irrational
Secrets of the JavaScript Ninja, Second Edition along with You Don't Know JS
are always my two recommendations. The two together shore up the weaknesses in
the other.

~~~
dccoolgai
Ninja is the best mid-level book period. Little heavy to starr out with, I
think.

------
bevacqua
Maybe check out Practical Modern JavaScript, which I wrote, which is free

[https://github.com/bevacqua/practical-
es6](https://github.com/bevacqua/practical-es6)

------
ThrustVectoring
This is a bit unorthodox, but I personally got a lot out of taking the LISP
code in Structure and Interpretation of Computer Programs, and mentally
translating the examples and solving the exercises in Javascript. There's
apparently versions of the text around with the exercises pre-translated,
though translating it myself was valuable to me.

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.

------
fL1Pm0d3
[https://github.com/MostlyAdequate/mostly-adequate-
guide](https://github.com/MostlyAdequate/mostly-adequate-guide)

~~~
ice109
nice book. do you know if this person plans on finishing part 3?

~~~
fL1Pm0d3
I think there is. The original author was consulting at the time it was
written and he released the book right at ES6 took headwind. Another
contributor has a fork and they are currently working to get the book up to
date with ES6. Once that is done I am sure they will move on to part 5.

[https://github.com/MostlyAdequate/mostly-adequate-
guide/pull...](https://github.com/MostlyAdequate/mostly-adequate-
guide/pull/273)

------
mixmastamyk
I liked Zakas' books, the older one [http://a.co/4e5JLrI](http://a.co/4e5JLrI)
for the breadth and history and the concise update:
[http://a.co/2U97acq](http://a.co/2U97acq)

~~~
narak
Would also recommend "Principles of Object Oriented JavaScript" by him:
[https://www.amazon.com/Principles-Object-Oriented-
JavaScript...](https://www.amazon.com/Principles-Object-Oriented-JavaScript-
Nicholas-Zakas/dp/1593275404/)

------
thinkxl
These:

\- Secrets of the JavaScript Ninja by John Resig (my favorite)

\- Eloquent JavaScript by Marijn Haverbeke

------
luminarious
[http://javascript.info](http://javascript.info) starts out simple enough for
complete beginners but goes deep enough that even intermediate users can find
new details.

------
Kequc
Is it strange that when I consider learning a new language, I don't turn to
books? My instinct is that I can learn more quickly and interactively online.
Particularly JavaScript, as the browser you are using to browse the websites
teaching you JavaScript is already a full JavaScript interpreter and
development suite.

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.

~~~
erickj
I use books for libraries and large software projects. For languages I use
books as references (early on, sometimes)

But for learning a new language, an editor and a hello world app are where I
start.

------
abraves10001
I think this question needs to be expanded upon before an adequate answer can
really be given.

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.

~~~
dec0dedab0de
What about someone who is proficient in python, can piece together awful
Javascript, has no fundamental understanding of the language structure, and is
overwhelmed by all the competing frameworks and build tools.

Lately I just turn to intercooler, but that's not a solution for everything.

~~~
abraves10001
I honestly don't know. Maybe read one of the books mentioned here, eloquent or
the good parts, and enroll in a course specific to a framework (i got a free
subscription to front-end masters, that has a few good courses) and go from
there.

------
ciw1973
"Eloquent Javascript"
([http://eloquentjavascript.net/](http://eloquentjavascript.net/)) definitely
gets my vote, as it starts with concepts that someone new to programming would
need to understand before diving into the specifics of the language. Available
to read online for free, although well worth spending money on a physical copy
to thumb through, but it may be a little too slow to get going for someone who
already has experience with other languages.

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](https://github.com/getify/You-Dont-Know-JS)), but consider buying them, as
he deserves to get paid.

------
koshelew
Having conducted over 100 interviews for JS positions, here is my advice.

\- 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/](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.

------
paultopia
FWIW, I started with Eloquent Javascript and moved on to You Don't Know JS.
For me (self-taught type but with some experience, mostly use Python and
Clojure) that seemed to do the trick, I'm working on a small Vue.js learning-
type project right now and it isn't horribly blowing up, I feel lots more
comfortable than I used to with JS, etc.

------
flavio81
My advice is, first make sure you are going to learn the latest version of
javascript, which is "Ecmascript2016" alias ES7 alias ES2016. ES2015 (alias
ES6) is also fine.

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:

ES6 [http://es6-features.org](http://es6-features.org)

ES7
[https://h3manth.com/new/blog/2015/es7-features/](https://h3manth.com/new/blog/2015/es7-features/)

------
mattferderer
I think it depends on your learning style & what you want to learn.
[http://jsbooks.revolunet.com/](http://jsbooks.revolunet.com/) is a great
resource for free books.

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.

------
itayadler
[http://speakingjs.com](http://speakingjs.com)

------
lpa22
I highly recommend Secrets of the JavaScript Ninja by John Resig. It boosted
my career significantly by giving me enough low-level practical understanding
to become much more productive writing JS. Highly recommended.

------
sivanesanms
JavaScript and JQuery - Murach. It's a two paged book. Left side you have text
and right side you have code. So it is easy to get what they are explaining.
Also they have good exercises to solve and learn.

------
vmware513
This page is a good start if you would like to learn modern JavaScript and a
framework at the same time: [http://yoember.com](http://yoember.com)

------
bhj
As a webdev who used JS for a while without really knowing what was going on
under the hood and just chalking "unexpected" behavior up to That Darn
JavaScript(TM), reading You Don't Know JS: Scope & Closures was really great:

[https://github.com/getify/You-Dont-Know-
JS/tree/master/scope...](https://github.com/getify/You-Dont-Know-
JS/tree/master/scope%20%26%20closures)

------
rammy1234
I used this books. Secrets of javascript Ninja -
[https://www.manning.com/books/secrets-of-the-javascript-
ninj...](https://www.manning.com/books/secrets-of-the-javascript-ninja)

javascript : good parts - [https://www.amazon.com/JavaScript-Good-Parts-
Douglas-Crockfo...](https://www.amazon.com/JavaScript-Good-Parts-Douglas-
Crockford/dp/0596517742)

------
predictand
If you are a beginner and looking for an engaging way to learn how to code
using JavaScript, I would suggest Coding for Visual Learners
([http://www.codingforvisuallearners.com](http://www.codingforvisuallearners.com)).
It makes no assumptions on prior programming knowledge and teaches you the
basics of coding using Javascript and p5.js in a very accessible manner.

 _Disclaimer: I am the author of the book_

------
johnhenry
I've only read parts, but Dr. Axel Rauschmayer has a few good books; Speaking
JavaScript, Exploring ES2016, and more available free online here:
[http://exploringjs.com/](http://exploringjs.com/). He also has an insightful
blog here: [http://2ality.com/](http://2ality.com/)

------
wh4this
[https://github.com/airbnb/javascript](https://github.com/airbnb/javascript)

------
lolive
Yet another option, if you are experienced with other languages and want to
learn JS: Javascript Enlightenment [1].

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...](http://www.javascriptenlightenment.com/JavaScript_Enlightenment.pdf)

------
aerovistae
As a supplementary resource rather than a primary learning guide, I found this
site[1] to be profoundly helpful. It explains a lot of the intricacies,
oddities, pitfalls and points of confusion in the language.

[1] [http://bonsaiden.github.io/JavaScript-
Garden](http://bonsaiden.github.io/JavaScript-Garden)

------
arthelon
You don't know JS goes quite in depth into a variety of areas. Worth reading
further down the road. [https://github.com/getify/You-Dont-Know-
JS](https://github.com/getify/You-Dont-Know-JS)

------
aalhad
Learning Javascript 3rd Edition by Ethan Browne published by O'Reilly - is one
of the few books for learning Javascript that have been published recently -
that start you off with ES6. I have found it very useful. Highly recommended.

------
CodeTheInternet
[https://addyosmani.com/resources/essentialjsdesignpatterns/b...](https://addyosmani.com/resources/essentialjsdesignpatterns/book/)

------
dijkstra123
If you need to read and understand the source code powering popular frameworks
then following is the best book.

JavaScript Patterns / Build Better Applications with Coding and Design
Patterns / By Stoyan Stefanov

------
theprop
Forget books, start coding!! To get going, CodeAcademy.com is amazing!!

~~~
dorkwood
Codecademy is good for the absolute basics, but I found anything beyond that
seriously lacking.

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.

~~~
abraves10001
I had the same experience, it gives a false sense of security. I can pass the
courses without having even a remedial understanding of the underlying
concepts.

~~~
theprop
Yes, true. It's basically good for someone who's never programmed before and
thinks "there's no way I could do this"...it gets someone going that way I
feel...

------
sbochins
This one:
[http://shop.oreilly.com/product/0636920028857.do](http://shop.oreilly.com/product/0636920028857.do)

------
wand3r
Do learn JavaScript the hard way on Zed's website. Once you know syntax read
addy osmanis book on design patterns; Google engineer gives great examples.

Also; JavaScript the good parts

------
ing33k
Exploring JS: JavaScript books for programmers ( free to read online )

* Speaking JavaScript

* Exploring ES6

* Exploring ES2016 and ES2017

[http://exploringjs.com](http://exploringjs.com)

------
marvel_boy
What about [http://exploringjs.com](http://exploringjs.com) books? Somebody
can comment about?

------
samirillian
Not a book, but I really like the format of nodeschool.io lessons.

------
z3t4
learn about closures and functions.

