Jump to ratings and reviews
Rate this book

Secrets of the JavaScript Ninja

Rate this book
Secrets of the JavaScript Ninja uses practical examples to clearly illustrate each core concept and technique. This completely revised edition shows you how to master key JavaScript concepts such as functions, closures, objects, prototypes, and promises. It covers APIs such as the DOM, events, and timers. You’ll discover best practice techniques such as testing, and cross-browser development, all taught from the perspective of skilled JavaScript practitioners.

370 pages, Paperback

First published January 1, 2008

Loading interface...
Loading interface...

About the author

John Resig

10 books23 followers

Ratings & Reviews

What do you think?
Rate this book

Friends & Following

Create a free account to discover what your friends think of this book!

Community Reviews

5 stars
555 (45%)
4 stars
452 (36%)
3 stars
176 (14%)
2 stars
36 (2%)
1 star
14 (1%)
Displaying 1 - 30 of 86 reviews
Profile Image for Denis.
8 reviews1 follower
July 15, 2013
Since JavaScript is the most popular language on GitHub, it is reasonable to assume that at some point any decent programmer will use it. For a long time, however, it has not been obvious whether we have to actually learn JavaScript. Some would even argue that CoffeeScript is a better language and we should skip learning JavaScript altogether.

In my opinion, this is a faulty path. Although some people, especially those with Ruby background, may find the syntax of CoffeeScript rather appealing, it is hardly a reason to avoid proper JavaScript training. And this book offers exactly that.

The book itself is very-well written and gives in-depth knowledge of how JavaScript works in browser environment. What's interesting here is that authors have deliberately chosen the path of not using JQuery in examples which perfectly reflects current trends. Indeed, the reality is that you will most likely end up using an MVC-framework and steer clear of manual DOM manipulation.

In the end I can make a bold statement and say that this book should be the default choice for anyone who has some programming experience and wants to learn JavaScript.
Profile Image for Jeanne Boyarsky.
Author 30 books67 followers
January 26, 2013
“Secrets of the JavaScript Ninja” has four parts. Two are awesome, one was ok and one went over my head. Let's look at each section in turn.

Preparing for training
The first two chapters cover some important concepts such as how to test, log and watch out for performance problems. I'll be honest. At this point in the book, I was thinking the book was “fair.” There was important information but it was a little dry. And there was page of code without any footnotes explaining it and only a brief description after. Luckily I kept reading. Because these two chapters were like a long introduction and nothing like the rest of the book.

Apprentice training
Here the book became fun. The writing style became more vivid and the information became more interesting. The authors point out gotchas and clearly walk you through examples. The code is set up that you HAVE to understand it and not just read along. We were introduced to closures by GENTLY bringing us up to speed and I particularly liked the regular expression coverage.

Ninja training
Advanced statements were covered clearly with pros and cons. I didn't see a warning about eval being slower than other statements but I did see a warning about security implications. I liked the cross browser chapter and advice on how to deal with differences in a supported manner. And the authors didn't just say “use jQuery” which was impressive restraint given we have the creator of jQuery and author of a jQuery book writing this one.

Master training
More than I think I ever want to know about events, the DOM and CSS in JavaScript. I'm treating these chapters as a reference. I wound up skimming because I had trouble focusing on that much detail. It was still good – and if you needed to use the information – it would probably be easier to focus on.

And some overall comments – the book assumes you know the basics of Javascript, HTML and CSS. If you don't, go pick up an intro to JavaScript book before reading this one. If you are doing any non-trivial JavaScript development you need this book. And if you are developing reusable JavaScript code (used on more than a handful of pages), you need this book badly.

Note: the book has been extensively re-edited and re-written since 2008. It's a different book from what the early reviewers read

Disclosure: I received a free copy of this book from the publisher in exchange for writing a review.
Profile Image for Naum.
156 reviews19 followers
January 13, 2013
I believe I purchased this book back in 2008 or 2009 -- it was an early purchase, with rights to read the developing digital text. Well, in 2013, a physical paper copy finally showed up on my doorstep.

Have seen criticism that this book doesn't cover asynchronous module loading and definition, newer javascript frameworks and/or that it looks like just a blatant money grab by jQuery creator and esteemed Javascript hacker emeritus John Resig. The latter charges are beyond silly and the beef about "application" model examination is folly, too. This book is a look into the Javascript language structure that enabled Resig to build a framework that should be of interest to anyone desiring to accomplish a project in the same vein. And an overarching comprehension of Javascript internals that make for building libraries and frameworks.
Profile Image for Ryan Chong.
22 reviews7 followers
May 31, 2018
This is by far the most clear cut, humorous and entertaining javascript book I have ever read.

When it comes to programming books, most of them are understandably quite technical and dry. Some may sound very academic and one just have to plow through the pages with lots of coffee to keep us awake.

But this book is different. Right from the attention-grabbing title, the authors turned the usually dry technical details into a highly entertaining book that peels away many mysteries of Javascript. Armed with witty examples and quirky sense of humor, they slowly deconstruct the fundamentals of Javascript(primitives, function as first class objects, regular expressions, modularizations) and browsers(event loops, working with DOM, css)

I especially appreciate the fact that they explained thoroughly how things were done pre-ES6 and why it was done in that way. It opens my eyes to how much pain the developers have to go through to accomplish a certain task and how ES6 solves that problem.

Understanding why something is done the way it is helps me appreciate the new way much more. It also made me understand what is going on behind the scenes so we don't just use the new synthetic sugars blindly.

It also helps that their examples are quite humorous as they always relates back to the ninja theme. In fact, one could even form a story from all their examples. (one ninja in particular, Hattori stood out repeatedly in their examples).

All in all, I think this is one of the best book about fundamentals of Javascript. I read the second version of this and I have no doubt that I will reread this over and over again to refresh my Javascript fundamentals.
Profile Image for Sebastian Gebski.
952 reviews842 followers
April 12, 2013
Another JavaScript book? What would be the point of reading another JavaScript book? These were exactly my thoughts, but I've reconsidered when I'd found out that it's author (John Resig) is creator of jQuery - it's certainly some kind of a proof that this dude is surely capable of telling you something valuable about JavaScript. Of course being a good programmer doesn't make you a good writer, but I was eager to take the risk.

So, the book is good, maybe even very good. I love the way he approached functions and closures - he was able to deliver some interesting info without going through all the basics. I like the way he approached object construction and threading - I've already knew majority of that, but it still wasn't a wasted time.

However, there were sections I didn't like at all: I see completely no point in chapters 1 & 2 - they were supposed to be some kind of intro, but they didn't match overall profile of expected reader (this ain't book for beginners). Whole part 4 (all chapters) is quite controversial as well - it may indeed be useful for someone who'd like to write a new JavaScript library without any dependencies, but who'd do that today really? Obviously knowing at a bit of internals won't hurt, but reading about the code I'll never use directly doesn't involve me really.

Anyway, it doesn't change the facts - it's a good book, surely worth reading.
Profile Image for Phat Nguyen.
34 reviews6 followers
November 17, 2016
Definitely one of the best books to read to become an excellent Javascript developer. The main difference between this book and others is that the author is amazingly experienced in writing Javascript code, and their understanding of the languages and new features is so deep that their main focus is to make sure the readers will gain a much deeper understading of the new features on the ground and the below mechanics underground.

The exercises are added to this new edition, but they serves mainly as questions to summarize what we learned rather than real exercises that takes lots of effort to finish.
Profile Image for Adolfo.
26 reviews2 followers
May 23, 2021
I recommend this book to anyone that wants to understand JS foundations and how some things happen under the hood. This is a book that I believe that brings knowledge that will help me to better understand tricky bugs and misbehaviours in my code. It also will definitely help me to avoid some traps that creates inefficient Javascript code.

This is not a book that will walk you through all the JS syntax, functions, ES6 spec and so on. It's about the foundations such as the different invocation modes for a function and how it impacts the creation of the "this" object. It's about the details regarding the event loop and the different queues used to keep track of all tasks that are executed in a single-threaded model. Why I can't get the response of a Promise while debugging a task taken from the macro-task queues? This is the kind of question I had in the past by not understanding the event-loop in depth.
What happens if you set the key of an array to an index bigger than its length?

After reading this, I consider it a must read to any developer that uses JS (but of course anyone can learn all the things in this book and beyond without reading this).
1 review
June 14, 2017
Absolutely fantastic book for anyone serious about his/her JavaScript skills.

In my opinion there are two categories of people who will benefit from reading this book. First - someone who has basic JavaScript knowledge and maybe used it for some time (couple of months). This person might want to enhance his/her JS skills and this book would be perfect for this. The second type is someone who is coming from another language but already has some programming knowledge. This book will help such person get up to speed with the modern JavaScript development and will make sure that you use the best JS practices while coding.

Will you become a JavaScript ninja after reading this book?
Although it covers a wide range of topics in great detail, there will still be a lot more you can learn about the language. Put it this way - most likely you will become a much better JS developer after reading it, however in my opinion this book is more like a transition into the truly advanced stuff. You will both, greatly increase the size of your toolbox and language understanding and also would be ready for the more advanced material discussed in other books.

I've done a very detailed review on my blog - http://standardcoder.com/book-review-... - which further outlines who will find this book the most useful. Also, to make it more helpful, I've included a detailed explanation of what exactly is covered in the book, so I hope you will find it useful, and my review will help to make a decision whether you should read this book or not.
Profile Image for Sergey Khomyuk.
56 reviews14 followers
July 16, 2013
Хорошая и полезная книга. В большинстве книг по JavaScript, которые я читал до этого в основном говорилось либо о самом языке, либо о работе с ним в рамках абстрактного браузера в вакууме. В "JavaScript Ninja" помимо общих вещей о языке, очень большое внимание уделяется нюансам работы в различных бра��зерах: feature detection, graceful degradation, events model, DOM model manipulation (attrs, quering, creation, duplication, ...). Да, jQuery позволяет забыть о многих из этих вещей, но знать как оно все работает внутри все равно крайне полезно. Единственное, что мне не понравилось в этой книге - так это стиль программирования John-а (уж больно он любит громоздкие конструкции). На одной строке кода может располагаться пара условных операторов, три-четыре вызова функции и пара присваиваний :) "Смотрите, как можно компактно писать на JavaScript", - восхищается John. Правда, после каждого примера идет текстовое описание на пару страниц, в котором все детально описывается, но лучше уж бы он писал само-документируемый код + пара inline комментариев в самых сложных местах.
В любом случае - "Secrets of the JavaScript Ninja" заслуживает 5 балов и заносится в список "must-read" на тему Client-Side Development.
1 review1 follower
April 11, 2017
It goes without saying that John deserves all the respect in the world. When he speaks (or writes a book), the wise thing to do is to be quiet and listen/read.

Having finished this book, my over-all review is that this was definitely a worth-while read. The reader shouldn't expect the skies to part and a beam of light to shine down. Personally, I found a few pearls.. very useful tips that I wasn't aware were possible (passing a callback function to String.replace to operate on regex capture groups, for example).. which can immediately be put to good use; (YMMV depending on your current skill level). But the real value of this book is that it's a relatively high-level guided tour of the implementation strategies for some of the major functional components in jQuery (by the man who wrote it). Hearing him discuss the considerations, trade-offs, and decisions ultimately taken sheds a lot of light into how to better utilize the tools that I use every day.. and am embarrassed to admit, largely just take for granted. For that, thank you John!

In the book, he jokingly comments that "the only code that doesn't suck is the code you write yourself". I humbly disagree; the code that John shares with us (the open-source community) is that rare exception. Again, thank you!

The following are my notes on the various minor editorial issues/typos/bugs/errata that I found in the text. They aren't intended to nitpick, but to offer constructive feedback. I apologize if these have already been mentioned by others/elsewhere.

___________________________________________________________
#01: page 105
___________________________________________________________
// ---------------------
// as illustrated:
Function.prototype.partial = function() {
var fn = this, args = Array.prototype.slice.call(arguments);
return function() {
var arg = 0;
for (var i = 0; i < args.length && arg < arguments.length; i++) {
if (args[i] === undefined) {
args[i] = arguments[arg++];
}
}
return fn.apply(this, args);
};
};

// ---------------------
/*
observation:
============
args is modified within the closure.
the 1st invokation will replace all undefined values.
all subsequent invokations will use the same identical parameters as specified by the 1st invokation.
*/

// ---------------------
// test:
var test_group = function(){
var delay = setTimeout.partial(undefined, 10);

delay(function(){
console.log('1st invokation..');
});

delay(function(){
console.log('2nd invokation..');
});

delay(function(){
console.log('3rd invokation..');
});
}
test_group();

// ---------------------
/*
console output:
===============
1st invokation..
1st invokation..
1st invokation..
*/

// ---------------------
// fix:
Function.prototype.partial = function() {
var fn = this, args_tpl = Array.prototype.slice.call(arguments);
return function() {
var args = Array.prototype.slice.call(args_tpl);
var arg = 0;
for (var i = 0; i < args.length && arg < arguments.length; i++) {
if (args[i] === undefined) {
args[i] = arguments[arg++];
}
}
return fn.apply(this, args);
};
};

// ---------------------
// test:
test_group();

// ---------------------
/*
console output:
===============
1st invokation..
2nd invokation..
3rd invokation..
*/
___________________________________________________________
// #02: page 246
___________________________________________________________
// ---------------------
/*
code:
=====
function getAllElements(name) {
if (!window.findByTagWorksAsExpected) {
window.findByTagWorksAsExpected = (function(){return boolean;})();
}
if (!window.findByTagWorksAsExpected) {
// do stuff..
}
}
*/

// ---------------------
/*
observation:
============
since the purpose of the 1st if() statement is to ensure that the value is only calculated once,
this methodology will fail when the calculated value === false.

the code should read something closer to..
*/

// ---------------------
/*
alt. code:
==========
function getAllElements(name) {
if (typeof window.findByTagWorksAsExpected !== 'boolean') {
window.findByTagWorksAsExpected = (function(){return boolean;})();
}
if (!window.findByTagWorksAsExpected) {
// do stuff..
}
}
*/
___________________________________________________________
// #03: page 246
___________________________________________________________
// ---------------------
/*
observation:
============
the statement:
if (allElements[n].nodeType === 1)
should be:
if (allElements[n].nodeType !== 1)
*/

// ---------------------
// test:
// browser = Firefox 24.0
// url = www.google.com

var allElements;
allElements = document.getElementsByTagName('*');
allElements = Array.prototype.slice.call(allElements);

console.log(allElements.length);
for (var n = allElements.length - 1; n >= 0; n--) {
if (allElements[n].nodeType === 1){
allElements.splice(n,1);
}
}
console.log(allElements.length);

// ---------------------
/*
console output:
===============
306
0
*/

// ---------------------
/*
summary:
========
I removed the outer conditional:
if (!window.findByTagWorksAsExpected){ ... }
By doing so, I can illustrate what would happen in IE when this loop runs.
Rather than removing "comment" nodes, it removes "element" nodes;
thereby returning an array of only "comment" nodes.
In FF, where the NodeList contains 0 "comment" nodes..
the final array will always have a length of 0.
*/
___________________________________________________________
// #04: page 259
___________________________________________________________
// ---------------------
/*
observation:
============
the statement:
var begin = new Date();
should occur after all other such variable initialization;
only the 1st test includes the call to:
getElementById()
which could possibly skew the results.
*/
___________________________________________________________
// #05: page 317-318
___________________________________________________________
// ---------------------
/*
thinking out loud:
==================
- triggerSubmitOnXYZ()
* bubble the "submit" event beginning from "this" (ie: not e.target)
* checks that e.target is contained within a
on every XYZ,
even before checking much less expensive conditions (such as keyCode).
- addSubmit()
* doesn't bother to listen for XYZ on elements
- what if the DOM looked like:
document -> -> ->
- use case (weird one):
* we bind a "submit" handler to:

which now causes
to also listen for XYZ and conditionally trigger its "submit" handler when certain realities are true
* is clicked/typed into/whatever.. to cause XYZ to bubble up and reach

question:
* should
care if doesn't?
- thoughts..
* maybe isInForm() should be moved from triggerSubmitOnXYZ() to addSubmit(),
such that triggerSubmitOnXYZ() is only bound to "this" when "this" isInForm.
this would also save us the cost of having to check whether e.target isInForm
each and every time the event handler(s) are called.
- more thoughts..
* should "submit" bubble from e.target rather than "this"?
I suppose that if there were a DOM element between
and which has also bound a "submit" handler to itself,
then it would have also been bound to triggerSubmitOnXYZ()..
and my point is moot.
* though.. strictly speaking,
rather than fixing broken behavior in this way,
which could become costly by assigning the work to every element that wishes to bind to an event that doesn't bubble properly,
because it can become redundant..
* ex:
document -> -> -> -> ->
when:
A1,A2,A3 are all bound to "submit",
which means that when bubbles XYZ:
- A3: will trigger its "submit" and bubble a "submit" event to
- A2: will receive XYZ (target == B),
which will cause it to fire its "submit" handler,
and bubble a "submit" event to ;
will receive "submit" (target == A3)
- A1: will receive XYZ (target == B),
which will cause it to fire its "submit" handler,
and bubble a "submit" event;
will receive "submit" (target == A3);
will receive "submit" (target == A2)
* point being,
it gets real messy.. real fast.
* but if:
addEvent(window, "load", function(){
if (isSubmitEventSupported) return;

var input_elements = document.getElementsByTagName('input');

var fix_submit_on_click = function(){
var click_handler = function(){
return triggerEvent(this,"submit");
};
var i, elem, type;
for (i=0; i elem = input_elements[i];
type = elem.getAttribute('type');
if (
(type === "submit" || type === "image") &&
isInForm(elem)
){
addEvent(elem, "click", click_handler);
}
}
};

var fix_submit_on_keypress = function(){
var keypress_handler = function(e){
if (e.keyCode === 13){
return triggerEvent(this,"submit");
}
};
var i, elem, type;
for (i=0; i elem = input_elements[i];
type = elem.getAttribute('type');
if (
(type === "text" || type === "password") &&
isInForm(elem)
){
addEvent(elem, "keypress", keypress_handler);
}
}
};

fix_submit_on_click();
fix_submit_on_keypress();
});
* then:
- "submit" can simply be bound to any element,
and our library is making the promise that the event will bubble to that element when it should
(in spite of a broken browser)
*/___________________________________________________________
// #06: page 320
___________________________________________________________
// ---------------------
/*
observation:
============
copy/paste mistake..

this.removeChange = function(){
// calls to: addEvent()
// should be changed to: removeEvent()
};
*/
___________________________________________________________
// #07: page 334
___________________________________________________________
// ---------------------
/*
observation:
============
random typos..

var tagName = htmlString.match(/<\w+/),
mapEntry = tagName ? map[tagName[0]] : null;
if (!mapEntry) mapEntry = [0, "", ""];
*/
___________________________________________________________
// #08: page 335
___________________________________________________________
// ---------------------
/*
observation:
============
inconsistent parameter types..
"args" is an array, when it's only purpose is to be passed to a function,
which has a signature that requires a string.

function insert(elems, args, callback) {
// ...
getNodes(args, doc, fragment)
}
*/
___________________________________________________________
Profile Image for Irina Lukyanenko.
25 reviews4 followers
March 5, 2019
На очень хорошем уровне объяснено, что такое функция в JavaScript и все с ней связанное (ее контекст и вызов, контекст выполнения, лексическая среда, замыкания, асинхронные действия, обещания).
Ещё отлично объяснено, как обрабатываются события (цикл ожидания событий, очереди макро- и микрозадач, распространение событий по модели DOM).
Нормально - прототипное наследование, но я бы посоветовала для лучшего понимания прочесть соответствующую главу в книге "Шаблоны JavaScript" С.Стефанов��.
Остальные же главы: управление доступом к объектам, коллекции, регулярные выражения, модуляризация, работа с моделью DOM - представлены в справочной форме (обще, но достаточно, чтобы использовать).
Profile Image for Cristian.
40 reviews
March 13, 2018
I’m a bit torn giving 3 stars to this book, since it’s packed with good info and I’d definitely recommend it to anyone wanting to learn JavaScript. Unfortunately, I felt it overly repetitive; most, if not all, of the relevant content can probably fit in half the amount of pages.
Profile Image for Doniyor.
7 reviews3 followers
Read
March 30, 2019
Really great book. I have got many knowledge from this book. I was't sure about how this keyword works in JS, after reading book I am confident with them
Profile Image for Alex Panayi.
2 reviews4 followers
November 23, 2018
I feel like i'm going absolutely insane. And no, it's not because of javascript.

To start off with, this book does an exceptional job in explaining the fine nuisances of the language, and provides clear examples to solve problems that you normally would not encounter in other languages. It does seem like most issues with Javascript is because Javascript is how Javascript is.

If you come from a programming background, this book is quite easy to understand and it really does do a great job of teaching you Javascript, and can be a great reference book. HOWEVER...

There are so many errors riddled in this book. Small errors, but definitely enough to throw someone off, especially a beginner who is just getting started with programming or learning Javascript. For example (I literally found these two errors just now, on the same page):

Chapter 9 example 3, the answer at the back of the book completely disregards the last pop();

Chapter 9 example 7, the answer states that the last two assertions will pass. Um, why? Where exactly is Hattori in the set? It was never added, nor was it declared in the beginning of the set declaration.

It just seems extremely lazy to overlook them, especially considering these are your own examples that you have added in.

Profile Image for Lim.
68 reviews1 follower
June 14, 2013
This is THE JavaScript book. I stumbled upon this book while searching for some alternatives to the crude JavaScript: The Good Parts. There is nothing wrong with Douglas Crockford's book; it's just too ... boring for me. John Resig has a more creative way to make you remember his teachings; every example chosen is a winner, and relevant as well, which is to be expected of the jQuery's inventor. This book will educate you from the language's basic to more advanced concepts such as the navigating through the DOM and analysing CSS selector engines. A must read from one of the most gifted JavaScript Ninjas out there.

Btw, I hate coding along while reading technical books but doing so is required if you want to get the most out of this one.
Profile Image for David Maixner.
98 reviews
August 14, 2017
awesome, this is real improvement over first edition, all that ES6 coverage and great examples of all different javascript aspects in assert form, really nice... what could be reduced is this duplicated text, like the explaining text in example followed by the same (or almost same) explaining text in paragraph, but once you get this scheme, it can be read much faster... I would like to read more about Node.js, I think javascript ninja should be familiar with server development as well... also some summary of 'use strict' would be nice (or at least list in index at the end of the book, neither is available)... but those were only small problems, the book itself is one of the best on JS I have seen
Profile Image for Jon Gauthier.
129 reviews216 followers
April 1, 2012
Some parts of the book were genuinely useful and interesting, providing introspection into things like closures and the unusual JS prototype model. The rest of the book, however, concerned itself with pointing out IE loopholes and minor points of things like eval and the DOM API. This may be interesting to some, but most web devs I know nowadays don't need to (and don't want to) worry about these things.
Profile Image for Daniel Dent.
69 reviews3 followers
February 25, 2015
Provides building blocks to understanding JavaScript (and JavaScript Frameworks) at deeper level. The depth of knowledge required by authors to write this book is incredible and often intimidating. If I could be 10% as good as them when writing JavaScript code I'd be content. This book feels like fundamental step on that journey.
Profile Image for Wayne Burkett.
7 reviews
April 29, 2020
The book is divided into three sections, which I'd describe like this:

1. The first third is about intermediate-to-advanced JavaScript topics (functions, closures, prototypes, timers, regular expressions) and it more or less holds up. Anybody could benefit from that section.

2. The middle section is about cross-browser stuff (styles, and with statements (for some reason?)). I read through this stuff much faster and it's mostly irrelevant to developing modern JavaScript. Devoting an entire section to the with statement was a bizarre and ultimately indefensible choice.

3. The final section relates mostly to creating your own JavaScript libraries. I'm sure some of this stuff is still relevant, but quite a lot of it won't be to most JS devs. If you're up for an exercise in learning-is-its-own-reward, then go for it, but I skimmed it pretty quickly.

Sadly, the book is quite poorly written. It could have used another editor. Or a ghost writer. I started writing down examples of imprecise, clunky sentences at the start of the fourth chapter and by the end of it I realized I'd run out of ink if I kept it up. Resig wasn't the man for this job (and his co-author doesn't appear to have been much help).

Finally, I understand the motivation to present topics in terms of unit tests, but it doesn't end up working very well. It's a tedious and verbose way to present new information.
38 reviews
August 24, 2022
My background: Software developer since 2010, and worked on a number of JavaScript web applications around 2012-2015. This was before common adoption of JS frameworks, JS dependency management, and when browser differences were especially problematic.

This book would be five stars except that it is 6 years out of date (written around 2015/2016). That said, 90%+ of the information was applicable.

For me, when I was younger, I just learned JavaScript in a piecemeal on-demand manner. What did `this` equal in a function? Why? I had no clue, mostly stumbled around and did well enough.

Now that I am picking up JavaScript again, I wanted to develop a rock-solid foundation. This book was great for that goal. It gives a lot of insight about how and why JavaScript works, and how it integrates with the browser's event loop.

A great follow-up resource is https://javascript.info/ - I've enjoyed it enough to pay for an offline copy.

Profile Image for David.
Author 1 book87 followers
April 17, 2023
A full decade this book has sat on my shelves. I've been doing more JS than usual lately and saw it and thought, "why not?" This has aged very well. Of course, some things are out of date (thank goodness!), but the core remains true and I would argue that Resig was quite prescient in the parts of the language he chose to highlight - he was right then and he's been proven right a decade later. If you want to learn REAL JavaScript (according to me), this is the stuff: function closures, judicious use of prototypes, and function closures. Throw the "class" keyword in the trash where it belongs. That's right, you heard me. This was rad stuff then and it's fundamental stuff now.
Profile Image for Ryan.
7 reviews
December 20, 2017
There was some useful content in this book. John Resig, author of jQuery, obviously knows what he's talking about. The book reinforced and augmented my JavaScript knowledge, but the overly verbose writing style and lame attempts at humor made getting through it feel like a chore. It's also kind of dated at this point, having been published in 2013. Because of this, there's no coverage of ES6 or latest browser enhancements. The later chapters that build up apis illustrating techniques used in jQuery were interesting.
Profile Image for Zack.
464 reviews5 followers
November 18, 2017
Not bad. Be prepared for some skimming if you already have years of programming experience, even in another language. I started this books after using JavaScript full time for a few months and didn't find too many surprises. Also if you're using Node or modern fully-featured frameworks, there may be better bang for your buck books.


"JavaScript ninja" makes it sound more advanced than it is. More of an low "intermediate" book.
Profile Image for Arthur Zhuk.
102 reviews2 followers
May 13, 2019
The best content on JS I've personally come across. John does a great job in his explanations and his friendly approach by using ninjas makes concepts that much simpler to wrap your head around. This book is great if you want to get a better understanding of the fundamentals and what's going on under the hood as well as getting ramped up with writing great modern JS. Book is full of awesome visuals depicting what's going on as well.
Profile Image for Austin.
8 reviews
April 9, 2023
Although it doesn't advertise as such; this gives a great understanding of how we got to modern JavaScript. From the creator of the outdated JQuery, I was pleasantly surprised with the tricks and nuggets buried in this one. Many of the additions I assumed were more modern syntactical advancements were actually there, albeit a little rough to implement.

Good read for anyone wanting to improve their skills in JavaScript.
Profile Image for David Maixner.
98 reviews
August 13, 2017
really great overview of javascript, even though nowadays I would pick the newer edition, which is covering lots of stuff from ES6... for this first edition, I especially enjoyed that function-related parts, which seems to be the most valid today, but there are some already outdated or not so very often used things, like browser bugs, eval and with...
Profile Image for RecursiveHaiku.
76 reviews1 follower
December 20, 2019
A solid read for anyone who wants to start writing JS or wants to learn more in depth concepts.
The book has a good pace and explains even more difficult concepts like prototypical inheritance in a way that is easy to understand.
This book does not come up nearly enough when people talk about what to read to get started with JS, but i definetly should!
Profile Image for Mohammad Elsheimy.
46 reviews8 followers
September 11, 2021
It's not that book that you learn something from scratch, not also a crash-course book for JavaScript, and absolutely not for beginners. It's one great book ONLY if you count it as a review!

Although some parts are very useful, specially those related to ES6, it's still only a small part of the whole book. Lots and lots of talking. It's much longer than what it should be.
Profile Image for Wilson Jimenez.
26 reviews5 followers
April 20, 2018
One of the best books to turn your JS knowledge from intermediate to advanced, I loved every chapter. Concepts are explained in such a granular way that even if you haven't read about it much before hand, you'll be able to get a grasp of it and follow along.
Displaying 1 - 30 of 86 reviews

Can't find what you're looking for?

Get help and learn more about the design.