Goodreads helps you keep track of books you want to read.
Start by marking “Scope and Closures (You Don't Know JS)” as Want to Read:
Scope and Closures (You Don't Know JS)
Enlarge cover
Rate this book
Clear rating
Open Preview

Scope and Closures (You Don't Know JS #2)

4.55  ·  Rating Details ·  501 Ratings  ·  48 Reviews
No matter how much experience you have with JavaScript, odds are you don't fully understand the language. This concise yet in-depth guide takes you inside scope and closures, two core concepts you need to know to become a more efficient and effective JavaScript programmer. You'll learn how and why they work, and how an understanding of closures can be a powerful part of ...more
Paperback, 98 pages
Published March 24th 2014 by O'Reilly Media (first published January 1st 2014)
More Details... edit details

Friend Reviews

To see what your friends thought of this book, please sign up.

Reader Q&A

To ask other readers questions about Scope and Closures, please sign up.

Be the first to ask a question about Scope and Closures

This book is not yet featured on Listopia. Add this book to your favorite list »

Community Reviews

(showing 1-30)
filter  |  sort: default (?)  |  Rating Details
Jun 24, 2015 Sallar rated it it was amazing
Does a programming book get better than this? I don't think so.
Dave Peticolas
Nov 27, 2015 Dave Peticolas rated it really liked it
What a great little book. This might be the first Javascript book I've managed to finish without having my eyes glaze over from the tedium. Modern technical books tend to lean far too much on how-to examples and not enough time on deeper explanations. This book focuses on one particular aspect of the language, scope rules and closures, and explains it in depth. The author understands how important well-crafted analogies and mental models are for achieving genuine understanding.
Ilya Ivanov
Sep 23, 2016 Ilya Ivanov rated it it was amazing
Marvelous book. Kyle deserves every cent received at Kickstarter.

The book is so concise, that it seems like every word is brushed until it shines, revealing the underlying truth about JavaScript and it's key differences from other languages.

Topics covered: scope, different types of scope, modules, IFFE, hoisting, closures, polyfilling. Code samples are short, intention revealing and very informative.

I've been through two books in this series and very thrilled to dive deeper into next books.

Mar 18, 2016 Jarek rated it it was amazing
Shelves: printed, non-fiction
Excellent book, which describes the subject to its full extent.
Jul 25, 2015 Affan rated it it was amazing
Shelves: programming
Awesome book. Helped me gain a better understanding of Scope and Closures and clear up some misconceptions! Before reading this book i actually thought JavaScript is an interpreted language but learned it is in fact a compiled language but its different from other compiled languages because compilation does not happen well in advance rather just milliseconds before execution. I also liked his definition of a closure, 'Closure is when a function is able to remember and access its lexical scope ...more
Jun 03, 2015 Dan rated it it was amazing
I needed something to explain scopes and closures to a Junior Dev I've started working with and mentoring recently. The usual examples and code samples weren't clicking, and I began to realize that, even for me, those old stand-by's weren't what actually got me to grock closure. I had to use the module pattern extensively before I really understood the concept at an intuitive level.

This book fills in what I needed experience to understand. It is concise, it is accurate, it is clear. You can't as
Joshua Isaac
Mar 28, 2015 Joshua Isaac rated it it was amazing
Shelves: programming
This book was a nice refresher of things I already knew, as well as a tidy introduction to some new syntax in EC6. I appreciated his coverage of IIFEs because that's syntax I'm always very confused about. This book was explicit in its scope (hah!) - it really didn't touch on much else besides scopes and closures - but it also didn't shy away from telling you about powerful language functions just because they are not nice to think about.
Jeff Richardson
Jun 09, 2014 Jeff Richardson rated it it was amazing
While I already considered myself somewhat of an expert when it came to scope and closure, I've read and heard Crockford talk about them a lot over the years, and Zakas books have a wealth of information on scope and closures as well I feel this book provided a new light on them. I'm a better Client Side Engineer for having read this book.
McCarthy Newball
Nov 22, 2016 McCarthy Newball rated it it was amazing
This book is awesome. I don't consider myself a JS connoisseur so this book has been of great value to me in building clearer core JS concepts. I didn't understand much what closures were; this little book will show you what closures are and you'll finally get it. These concepts are essential for understanding JS. Without them you might be a hazardous JS coder.
Nov 15, 2016 Magnús rated it really liked it
Holl og góð lesning fyrir Javascript nörda.

Sjá umfjöllun sem ég skrifaði um fyrstu bókina hér.
Oct 29, 2016 Kevin rated it it was amazing
Good and quick book that clarifies some of the basic tenets of Javascript.
Mohammad Kermani
Oct 03, 2016 Mohammad Kermani rated it it was amazing
I just can say, at what level you are (beginner or advanced) this book is helpful
Sep 28, 2016 Johnny rated it it was amazing
This book is excellent for anyone who wants to understand better the mechanisms of Scope and Closures in JavaScript.

The book is well written and the content well explained.

In the Appendix B where Kyle talk about transpilers I think would be good to mention Babel and not just Traceur, because Babel it's one of the most used JS's transpilers today.
Saeed Mehraboon
Jul 18, 2016 Saeed Mehraboon rated it really liked it
Shelves: en, علمی
This part of the book wasn't new to me. I've almost knew everything it said (excepts ES6 related stuff) but the road to that understanding for me was a long road with lots of ups and downs. If I've read that before I dive into implementing web apps, only God knows how much time I would save.
I'm happy I found about this book, cause not only it takes you into under the hood of js and tells you all the magic you knew about but never had the chance to understand the 'why's, but also it helps you org
Ryan Boone
Sep 05, 2015 Ryan Boone rated it it was amazing  ·  review of another edition
If you want to better understand JavaScript, you absolutely need to read the You Don't Know JS series. Then read it again. Then read it again. These are great reference books to return to when you're having trouble figuring out why a callback is returning undefined when it should be giving you an object, or how you can clean up the global namespace. His book is well-written and full of example code. Get this book and follow along in your favorite JS editor.
Inderzit Sidhu
Dec 02, 2015 Inderzit Sidhu rated it liked it
Shelves: programming
Topics are covered in too much detail and too softly for my taste. I like fast paced books which cover a lot of topics in small space. This is very good book for beginners, but someone who knows Javascript in good detail, this seems boring for most part. The book also doesn't leave a lot to think about Javascript as it gives almost all the answers to your "what-if?" questions. Though its a good read, I don't have plan to touch the second book of the series in the near future.
Nirmal Patel
Jul 15, 2016 Nirmal Patel rated it it was amazing
Just Awesome. If You are coding JS for few years, and had some moments where you find difficulty to understand it in details, then this book is your solution. It will start with explaining How JS works behind the scenes and then it explores scope and closures in more details. By the time you end this book, you will realize that you are using all the stuff mentioned in book but never know about it.
Tyrone Mitchell
Jul 22, 2014 Tyrone Mitchell rated it it was amazing  ·  review of another edition
Concise and informative. When I was about 2/3 through the book, I decided to restart it to really get some of the examples and understand the concepts even better.

It may seem to be counterintuitive to say that it's informative and yet I had to read it multiple times. However, closure is one of the trickiest concepts in JavaScript.
Nestor Mata Cuthbert
Jul 12, 2014 Nestor Mata Cuthbert rated it it was amazing
Quick and easy book, it gives you strong foundations that even if you are a experience JavaScript developer you may not know completely.
I would say is a must read for anyone who consider him self a JavaScript developer or is looking to became one.
Alessandro Pellizzari
Dal primo capitolo sembrava abbastanza banale e poco utile, e in alcuni punti nemmeno spiegato molto bene, ma ho dovuto ricredermi nei capitoli successivi.
Copre sia ES5 che le novità introdotte con ES6 e successivi.
Michael Barzizza
Jul 24, 2015 Michael Barzizza rated it it was amazing
This is a great explanation of scope and closures. Simpson dives into the JS compilation process and explains lexical scope based on this context. He also discusses hoisting and gives a clear explanation of IIFEs.
Marc Udoff
Nov 07, 2015 Marc Udoff rated it liked it
This was a short good enough read, but not a good as his Async & Performance book. It does help clarify some topics but overall I don't feel as wowed as the other. Maybe I just knew enough of the topic to be bored or maybe the topic is a little bland?
David Deren
Feb 25, 2015 David Deren rated it really liked it  ·  review of another edition
exactly what i hoped for.

Clear, concise, humorous in places without ever being over the top. It does a great job at explaining the why's of some of the behaviours of javascript you encounter every day without really thinking about them. I can't wait to use lets in my loops :).
Aug 15, 2015 Dave rated it it was amazing
Recommends it for: Anyone writing JavaScript
Before I started reading the "You Don't Know JS" books I thought JavaScript was poorly designed and only coded in it because I had to. But once you understand the rules of lexical scoping, hoisting, etc., thanks to this very well-written book, the language becomes a lot more clear and friendly.
Brieuc Desoutter
Sep 02, 2016 Brieuc Desoutter rated it really liked it
Pinpoint some important aspects of Javascript scoping rules which can be quite mind boggling if you don't understand how they work. Definitely a must read.
Deepak Sandhu
this is the best book on topic. Some might argue why get a book on just a one part of JS where you can get books which go over complete JS in one. But after reading this you will understand how is there to learn about closures and how much lost you can be when you dont know JS completely.
Aug 21, 2016 Vedran rated it it was amazing
Concise, simple and straightforward explanations of some of the JavaScript's most mystified concepts.
Jul 29, 2016 Scott rated it it was amazing
If you know the subject you will not find much extra insight in this title, but if you do not this book will feel like it was heaven sent. It's a quick read written with mastery.
Aug 13, 2015 Jorge rated it it was amazing
clear, concise, and well explained; for a starter is a great reference, for someone who had worked with JS will understand the "why" of some topics
Mar 21, 2014 Jeff rated it it was amazing
An excellent, quick read. Really looking forward to the other books in this series. Hope they are coming soon!
« previous 1 3 4 5 6 7 8 9 next »
There are no discussion topics on this book yet. Be the first to start one »
  • The Principles of Object-Oriented JavaScript
  • Programming JavaScript Applications: Robust Web Architecture With Node, HTML5, and Modern JS Libraries
  • Object-Oriented JavaScript
  • jQuery Cookbook: Solutions & Examples for jQuery Developers
  • Functional JavaScript: Introducing Functional Programming with Underscore.js
  • Even Faster Web Sites
  • Professional Node.Js: Building JavaScript Based Scalable Software
  • HTML5: Up and Running
  • Mobile Design Pattern Gallery: UI Patterns for Mobile Applications
  • High Performance Browser Networking
  • Pro Git
  • Speaking JavaScript
  • Pro AngularJS (Expert's Voice in Web Development)
  • Professional PHP Programming
  • Simply JavaScript
  • Modern PHP: New Features and Good Practices
  • Effective JavaScript: 68 Specific Ways to Harness the Power of JavaScript
  • Beginning Linux Programming

Goodreads is hiring!

If you like books and love to build cool products, we may be looking for you.
Learn more »
Kyle Simpson is an Open Web Evangelist from Austin, TX, who's passionate about all things JavaScript. He's an author, workshop trainer, tech speaker, and OSS contributor/leader.
More about Kyle Simpson...

Other Books in the Series

You Don't Know JS (6 books)
  • You Don't Know JS: Up & Going
  • You Don't Know Js: This & Object Prototypes
  • You Don't Know Js: Types & Grammar
  • You Don't Know Js: ASYNC & Performance
  • You Don't Know Js: Es6 & Beyond

Share This Book

“Closure is when a function is able to remember and access its lexical scope even when that function is executing outside its lexical scope.” 2 likes
More quotes…