Enjoy fast, free delivery, exclusive deals, and award-winning movies & TV shows with Prime
Try Prime
and start saving today with fast, free delivery
Amazon Prime includes:
Fast, FREE Delivery is available to Prime members. To join, select "Try Amazon Prime and start saving today with Fast, FREE Delivery" below the Add to Cart button.
Amazon Prime members enjoy:- Cardmembers earn 5% Back at Amazon.com with a Prime Credit Card.
- Unlimited Free Two-Day Delivery
- Streaming of thousands of movies and TV shows with limited ads on Prime Video.
- A Kindle book to borrow for free each month - with no due dates
- Listen to over 2 million songs and hundreds of playlists
- Unlimited photo storage with anywhere access
Important: Your credit card will NOT be charged when you start your free trial or if you cancel during the trial period. If you're happy with Amazon Prime, do nothing. At the end of the free trial, your membership will automatically upgrade to a monthly membership.
Buy new:
-52% $14.33$14.33
Ships from: Amazon.com Sold by: Amazon.com
Save with Used - Good
$5.37$5.37
Ships from: Amazon Sold by: Books For You Today
Download the free Kindle app and start reading Kindle books instantly on your smartphone, tablet, or computer - no Kindle device required.
Read instantly on your browser with Kindle for Web.
Using your mobile phone camera - scan the code below and download the Kindle app.
Follow the author
OK
JavaScript: The Good Parts: The Good Parts 1st Edition
Purchase options and add-ons
Most programming languages contain good and bad parts, but JavaScript has more than its share of the bad, having been developed and released in a hurry before it could be refined. This authoritative book scrapes away these bad features to reveal a subset of JavaScript that's more reliable, readable, and maintainable than the language as a whole—a subset you can use to create truly extensible and efficient code.
Considered the JavaScript expert by many people in the development community, author Douglas Crockford identifies the abundance of good ideas that make JavaScript an outstanding object-oriented programming language-ideas such as functions, loose typing, dynamic objects, and an expressive object literal notation. Unfortunately, these good ideas are mixed in with bad and downright awful ideas, like a programming model based on global variables.
When Java applets failed, JavaScript became the language of the Web by default, making its popularity almost completely independent of its qualities as a programming language. In JavaScript: The Good Parts, Crockford finally digs through the steaming pile of good intentions and blunders to give you a detailed look at all the genuinely elegant parts of JavaScript, including:
- Syntax
- Objects
- Functions
- Inheritance
- Arrays
- Regular expressions
- Methods
- Style
- Beautiful features
The real beauty? As you move ahead with the subset of JavaScript that this book presents, you'll also sidestep the need to unlearn all the bad parts. Of course, if you want to find out more about the bad parts and how to use them badly, simply consult any other JavaScript book.
With JavaScript: The Good Parts, you'll discover a beautiful, elegant, lightweight and highly expressive language that lets you create effective code, whether you're managing object libraries or just trying to get Ajax to run fast. If you develop sites or applications for the Web, this book is an absolute must.
- ISBN-100596517742
- ISBN-13978-0596517748
- Edition1st
- PublisherYahoo Press
- Publication dateJune 3, 2008
- LanguageEnglish
- Dimensions7 x 0.38 x 9.19 inches
- Print length172 pages
Frequently bought together

Similar items that ship from close to you
From the brand
-
-
Sharing the knowledge of experts
O'Reilly's mission is to change the world by sharing the knowledge of innovators. For over 40 years, we've inspired companies and individuals to do new things (and do them better) by providing the skills and understanding that are necessary for success.
Our customers are hungry to build the innovations that propel the world forward. And we help them do just that.
From the Publisher
From the Preface
This is a book about the JavaScript programming language. It is intended for programmers who, by happenstance or curiosity, are venturing into JavaScript for the first time. It is also intended for programmers who have been working with JavaScript at a novice level and are now ready for a more sophisticated relationship with the language. JavaScript is a surprisingly powerful language. Its presents some challenges, but being a small language, it is easily mastered.
My goal here is to help you to learn to think in JavaScript. I will show you the components of the language and start you on the process of discovering the ways those components can be put together. This is not a reference book. It is not exhaustive about the language and its quirks. It doesn't contain everything you'll ever need to know. That stuff you can easily find online. Instead, this book just contains the things that are really important.
This is not a book for beginners. Someday I hope to write a JavaScript: The First Parts book, but this is not that book. This is not a book about Ajax or web programming. The focus is exclusively on JavaScript, which is just one of the languages the web developer must master.
Editorial Reviews
About the Author
Douglas Crockford is a Senior JavaScript Architect at Yahoo!, well known for introducing and maintaining the JSON (JavaScript Object Notation) format. He's a regular speaker at conferences on advanced JavaScript topics, and serves on the ECMAScript committee.
Product details
- Publisher : Yahoo Press; 1st edition (June 3, 2008)
- Language : English
- Paperback : 172 pages
- ISBN-10 : 0596517742
- ISBN-13 : 978-0596517748
- Item Weight : 8.6 ounces
- Dimensions : 7 x 0.38 x 9.19 inches
- Best Sellers Rank: #193,532 in Books (See Top 100 in Books)
- #29 in JavaScript Programming (Books)
- #195 in Software Development (Books)
- #196 in Internet & Telecommunications
- Customer Reviews:
About the author

Douglas Crockford is the author of How JavaScript Works. He has been called a JavaScript Guru, but he is more of a Mahatma. He was born in Frostbite Falls, Minnesota, but left when he was only six months old because it was just too damn cold. He has worked in learning systems, small business systems, office automation, games, interactive music, multimedia, location-based entertainment, social systems, and programming languages. He is the inventor of Tilton, the ugliest programming language that was not specifically designed to be an ugly programming language. He is best known for having discovered that there are good parts in JavaScript. That was the first important discovery of the Twenty First Century. He also discovered the JSON Data Interchange Format, the world’s most loved data format.
Customer reviews
Customer Reviews, including Product Star Ratings help customers to learn more about the product and decide whether it is the right product for them.
To calculate the overall star rating and percentage breakdown by star, we don’t use a simple average. Instead, our system considers things like how recent a review is and if the reviewer bought the item on Amazon. It also analyzed reviews to verify trustworthiness.
Learn more how customers reviews work on AmazonCustomers say
Customers find the book's content great, opinionated, and refreshing. They also describe the length as short, to the point, and dense. Readers describe the writing style as beautiful and pragmatic. Opinions are mixed on readability, complexity, and conciseness. Some find it simple and concise, while others say it's too full of jargon and difficult to write robust production quality code.
AI-generated from the text of customer reviews
Customers find the book's content great, pragmatic, and practical. They say it's thought-provoking and refreshing. Readers also mention that the book is packed full of good material.
"...Also there is a good reference for some of the more used methods that are tied to the prototypes objects.10...." Read more
"...In parallel, this book also serves as a well-reasoned best-practices manual for writing good JavaScript code (a la Crawford...)...." Read more
"...This book is NOT for beginners to programming.This book is very opinionated on what the core language constructs are and how to use them and..." Read more
"...All in all, this book is worth the read. It is quick and thought-provoking, as well as a valuable addition to the bookshelf." Read more
Customers find the book brilliant, straightforward, clear, and to the point. They also say it's really useful for newbies.
"...Perhaps not.Overall, a great read. Something you can refer to many times." Read more
"...I, for one, found it to be very interesting and useful...." Read more
"...All in all, this book is worth the read. It is quick and thought-provoking, as well as a valuable addition to the bookshelf." Read more
"...The end result is worth the time invested: you will be a better programmer for having digested the information provided by Mr. Crockford...." Read more
Customers find the book short and to the point. They also say the author is easy to read and gets right to the points.
"I just finished this book. It's relatively short but you have to invest a lot of hours to properly absorb it...." Read more
"...10. It is short and does not teach you anything about JS, but pretty much sums why adding every single library you can is probably a terrible idea." Read more
"...There's more than one way to achieve this effect. In this short and illuminating title, Crawford delineates one such way, which relies on some..." Read more
"...This book is small but quite dense...." Read more
Customers find the writing style of the book beautiful and helpful for writing beautiful code.
"...This book would pair nicely with Beautiful Code...." Read more
"...JavaScript can be elegant and powerful in ways that more traditional languages can't...." Read more
"...But it's lovely...." Read more
"...The Kindle version looks great, everything is readable. The chapters andsections are light and terse, you get a lot of bang for your buck...." Read more
Customers appreciate the great quality of the book. They say it allows them to write reliable JS.
"...of this concept is the clearest that I've read, with plenty of well-made examples...." Read more
"...Must have.Book is made in great quality, characteristic for O'Reilly." Read more
"...the best practices to make your javascript code more readable, maintainable and really take full advantage of the good parts of the language." Read more
"...his/her ability to produce client-side code that is flexible and maintainable." Read more
Customers are mixed about the complexity level of the book. Some mention that the syntax of Javascript is easy to read in an easy way, while staying away from the powerful programming language. They also appreciate the terseness of the content, saying it's a very short book to read through. However, other customers say that the book is too full of jargon, poorly written, and presented, making it difficult to grasp. They feel the examples are atrocious and misleading.
"...Some chapters, such as "Arrays" are not difficult and allow a bit of relaxation. I personally like the railroad diagrams...." Read more
"...had", others said the information was poorly organized and not written very well. Others complained about his ego getting in the way...." Read more
"...In the appendices of this books, you'll find a superbly succinct-yet-exhaustive descrpition of the popular JSON data-interchange format, of which..." Read more
"...Crockford's writing style is clear and concise, spritzed with some lighthearted humor...." Read more
Customers are mixed about the readability of the book. Some mention it's small, but dense, while others say it provides a good, if rather dense, overview of best practices.
"...The book is thin but packed full of good material...." Read more
"...If that has no meaning for you, skip this item. Like K & R, it's thin but gets dense quickly. This is for a serious developer...." Read more
"This book provides a good, if rather dense, overview of best practices when writing JavaScript code, including criticism of some of the features..." Read more
"...The book is pretty short, but it's also dense...." Read more
Customers are mixed about the conciseness of the book. Some mention that it has a no-fluff approach in presenting the subject matter, while others say that it just babbles on.
"...for the well seasoned software engineer looking for a no nonsense, no fluff, to the point, direct in content, high on information, short on..." Read more
"...book only contains about 25 pages or so of worthy material; the rest is just fluff." Read more
"...Crockford has taken a condensed, no-fluff approach in presenting the subject matter, so it takes more then a single reading to internalize the..." Read more
"...Useless, teaches nothing, just babbles on." Read more
Reviews with images
Cannot learn JavaScript from this book
-
Top reviews
Top reviews from the United States
There was a problem filtering reviews right now. Please try again later.
Chapters 3, 4 and 5 are the heart of the book. These thirty-six pages more than justify the book's cost. I tend to buy smaller books these days. This book reached a new high for the amount of useful content divided by price. (Rivaled by the "K & R" book. But have you priced that sucker lately?)
If you're new to Javascript and/or programming and wonder whether you should buy this book: go ahead. You will get more out of it than you might expect. Some chapters, such as "Arrays" are not difficult and allow a bit of relaxation. I personally like the railroad diagrams. These grammar diagrams are repeated in the back of the book -- a bit of redundancy.
I have to stretch to find something to gripe about, but here goes. In places, Crockford's explanation of a language flaw or limitation is immediately followed by a fix, usually by augmenting one of the base prototypes. It likely shows my own unfamiliarity with his subject matter, but I find these "corrections" jarring: I haven't yet grasped all the language features and here you are changing them in front of me. I'm not sure whether moving these fixes to a separate section(s) would be an improvement. Perhaps not.
Overall, a great read. Something you can refer to many times.
I do not understand the majority of complaints. Some compare Crockford to "the most boring professor you ever had", others said the information was poorly organized and not written very well. Others complained about his ego getting in the way. I, for one, found it to be very interesting and useful. Parts of it were a struggle to get through (and I've been a C coder for 20+ years) but mental challenges are a software engineer's specialty.
In my opinion, none of the complaints are completely true, assuming you are the right audience. This book is NOT for beginners. If you are relatively new to Javascript, it will definitely be useful, but if you are new to programming entirely, this book is not for you. This is a more academic book that gives you a peek behind the scenes to the inner workings of the Javascript language. It is more comparable to K&R's book for C Programmers, but not as complete (just the "good" and "awful" parts!).
It is a book about the Javascript LANGUAGE. It is NOT a book on web programming. It will NOT teach you anything about HTML, or the DOM, or how to put little fiddlly-bits on the screen, or how to work out game physics, or how to use any HTML-specific components. It is a book on the constructs of Javascript, plain and simple. It should NEVER be the only book on Javascript you would own, but if you are serious about Javascript, it should definitely be in your library. I don't think you can be a Javascript master without this book.
My minor grievances are mostly limited to subjective areas where I disagree with him:
1) He states his opinion absolutely, more so in the first part of the book. I prefer a less forceful approach that presents the arguments and lets you decide for yourself. However, I do not feel he went overboard in this regard as some did - I suspect they didn't get very far into the book.
2) While I completely understand the Javascript bugaboo that makes a case for mis-aligned curly braces (K&R style). I cannot get myself to follow this convention (except in a few areas where I make exceptions) To me, code is SO much easier to follow when all blocks are aligned. I will heed his advice and avoid the lurking JS bug, but I will not fully convert to misaligned braces. I resent that his JSLint tool generates hundreds of errors in my code because of this - but fortunately, there's an option to turn it off.
3) When he digs into some of the JS-specific patterns that aren't familiar to non-JS programmers, I wish he would add a disclaimer along the lines of "while this is a powerful tool, understand that depending on such patterns may make the code more difficult to maintain by others less trained in the specifics of Javascript. Or at least comment vigorously." I am a firm believer in "clarity over cleverness" in shared code.
4) In some of the trickier subjects, a few more examples would makes things easier to comprehend. I've never really used Regular Expressions before, and the chapter left my head swimming, and I felt the explanation of the various components of the expressions could have been better.
But these are not major grievances, and I whole-heartily recommend this book for the intermediate Javascript user or the novice JS user who has a solid background in general programming language constructs.
This book would pair nicely with Beautiful Code. The author mentions his article in the book, in that article he also looks at JS's good parts but in a simplified way.
The biggest thing to note when going into this book: the author emphasizes the importance of objects in JS, the use of functions and variables to manage objects and efficiently create JS programs. He also gives a section on the terrible parts of JS, just for one to understand and avoid them. All-in-all, it is a compact good book, a bit succinct on the more complex subjects. However go to stackoverflow and search/ask some questions if you are confused.
In my opinion the best chapters:
2-3. Intermingling this with actual coding on your part (utilizing JSbin or JSfiddle, etc) will help you get the most out of understanding some of the behaviors of the language. Pretty much utilizing objects is your best bet for creating efficient and usable JS code. 6 pretty much sums why arrays are inefficient in JS.
4-5, 8. This helps one understand the importance of functions in JS. Also there is a good reference for some of the more used methods that are tied to the prototypes objects.
10. It is short and does not teach you anything about JS, but pretty much sums why adding every single library you can is probably a terrible idea.
Top reviews from other countries
What it is good for is as a concise and yet in depth coverage of some of the finer points of Javascript, and as gentle guidance towards the bits that aren't bad (which are helpfully listed in Appendix A: Awful Parts and Appendix B: Bad Parts).
At a decade old it's showing it's age a little bit, and doesn't cover any of the shiny new ES5 / ES6 features. It'd be nice to see coverage of arrow functions in Chapter 4: Functions, especially around the complexities of the "this" keyword. A lot of Chapter 5: Inheritance is dated now that the class keyword syntactic sugar is a thing. Functional programming is covered, but map / reduce / filter aren't, having been standardised the year after JS:TGP was released. Promises are completely uncovered.
As someone coming from an OO background it'd be good to see a brief introduction to idiomatic ways of achieving tasks in JS, e.g. the concept of monkey patching in unit tests.
Like the author said, This book is small, but it is dense. It is very hard to understand some pages in the first read. I read every pages at least 3 times, some pages more than 10 times to get the idea fully. But the effort definitely got rewarded.









