Whole-book reading guide from stratified index samples; jump to passages in the text
Tip the Site
Support this siteYour recognition and a small knowledge-service contribution help keep this technical work open source.Scan the WeChat Pay or Alipay code below. Logged-in and guest visitors can both tip.
WeChat Pay
Alipay
Open WeChat or Alipay and scan. No login required.
AI guide
# You Don't Know JS: Up & Going / ES6 & Beyond (Chinese Edition)
## 【One-Line Pitch】
A two-part deep dive that first rebuilds your JavaScript fundamentals from scratch—types, scope, closures, and the "why" behind the language's quirks—then walks you through the most important ES6 features with practical, opinionated guidance. Ideal for developers who've written JS for years but never stopped to understand how it actually works.
## 【Book Arc】
- **Opening (~0%–13%)**: The book opens with a manifesto against "good enough" JavaScript learning, arguing that developers who avoid understanding the language's complex parts end up fearing and misusing them. It then transitions into the first major section, "Up & Going," which starts with absolute basics—values, types, and variables—as a foundation for everything that follows.
- **Early (~13%–29%)**: This stage covers core programming mechanics: blocks, conditionals, loops, functions, and scope. The key insight here is that **scope is lexical**—each function creates its own variable container, and nested functions can access outer scopes. The section also introduces the seven built-in types and the infamous `typeof null === "object"` bug, which the author argues will never be fixed because too much web code depends on it.
- **Early (~29%–32%)**: A bridge section on closures, IIFEs, and the "old vs. new" problem. Closures are framed as "memory"—a function that remembers its outer scope even after that scope has finished running. The book then introduces polyfilling and transpiling as the two strategies for using modern features in old browsers, setting up the ES6 material that follows.
- **Middle (~32%–48%)**: The ES6 & Beyond section begins with the philosophy of "feature-based" thinking instead of version-based thinking, then dives into syntax: block-scoped `let` declarations (with a warning about the "mental tax" of implicit scoping), default parameter values, destructuring (including the subtle difference between destructuring defaults and parameter defaults), and concise methods. The author is refreshingly opinionated—he argues arrow functions' readability benefits shrink as function length grows.
- **Late (~48%–end)**: The book continues through iterators, generators, modules, classes, and collections (Map, WeakMap, Set). The excerpts show a strong emphasis on **custom iterators** and the `for..of` loop, with the note that plain objects are intentionally not iterable by default—a design decision, not a bug. The book closes by positioning itself as the entry point to the broader "You Don't Know JS" series.
## 【Key Takeaways】
- **Implicit coercion is learnable, not a flaw** (Early): The book pushes back on the common belief that JavaScript's type coercion is a design defect. Once you learn the rules—like `"99.99" == 99.99` converting the string to a number—you can write better programs instead of avoiding the feature entirely.
- **Only values have types, not variables** (Early): `typeof a` asks "what type is the value currently in `a`?", not "what type is `a`?". This distinction matters because a variable can hold a string, number, and object over its lifetime, and `typeof` reflects only the current value.
- **Scope is lexical and nestable** (Early): Each function creates its own scope, and inner scopes can access outer ones—like balloons inside balloons. This is the foundation for understanding closures, which the book calls "one of the most important techniques in your JS toolkit."
- **Closures are memory** (Early): A function returned from another function "remembers" the outer function's variables even after the outer function has finished. The `makeAdder` example shows how each call creates a new "memory" of the `x` parameter.
- **Polyfilling and transpiling bridge old and new** (Early): Instead of waiting years for old browsers to die, you can write ES6 today. Polyfills replicate new features in old environments (like `Number.isNaN`), while transpilers convert ES6 syntax to ES5-equivalent code.
- **`let` is block-scoped but implicit** (Middle): Unlike `var`, which belongs to the whole function, `let` belongs to its block—but this is invisible in the syntax. The author coins "mental tax" for the confusion this causes, and warns that accessing a `let` variable before its declaration throws an error, unlike `var`.
- **Destructuring defaults ≠ parameter defaults** (Middle): A subtle but critical distinction. `function f6({x = 10} = {}, {y} = {y: 10})` behaves differently from what you'd expect: calling `f6({}, {})` gives `10 undefined` because the second parameter's default only applies when the argument is missing or `undefined`, not when it's an empty object.
- **Arrow functions are about `this`, not just syntax** (Middle): The main design goal of `=>` is to change `this` binding behavior, not to save keystrokes. The author advises using them only for short inline functions, since readability gains shrink as function length grows.
## 【Reading Tips】
- **Skim the first 13% if you're experienced**: The opening "Up & Going" section covers basics like variables, blocks, and conditionals. If you've written JS for more than a year, jump ahead to the scope and closure material around the 20–30% mark, where the book gets distinctive.
- **Deep-read the ES6 syntax chapters (30–50%)**: The destructuring, default parameters, and concise method sections contain subtle gotchas that will trip you up in real code. Pay special attention to the `f6({}, {})` example—it's the kind of edge case that causes production bugs.
- **Treat the arrow function section as a debate, not a tutorial**: The author argues against overusing `=>` and makes a case for readability over brevity. Even if you disagree, this is valuable perspective for code review discussions.
- **Use the "old vs. new" chapter as a mental model**: The polyfill/transpile discussion (around 29%) is short but essential for understanding how to adopt ES6 features without breaking older browsers. It also explains why the ecosystem moved to feature-based thinking instead of version-based.
- **Don't expect deep coverage of generators and classes**: The excerpts show these topics exist (iterators, generators, modules, classes, Map/WeakMap/Set), but the sample material doesn't include their full treatment. If these are your primary interest, you may need supplementary resources.
## 【Coverage Limits】
The excerpts cover the "Up & Going" fundamentals and the early-to-middle portions of the ES6 & Beyond section (syntax, destructuring, arrow functions, iterators). The guide does not cover the book's later chapters on generators, modules, classes, and collections in depth, nor the final "ES6 & Beyond" summary material.
##
Support this siteYour recognition and a small knowledge-service contribution help keep this technical work open source.
Scan the WeChat Pay or Alipay code below. Logged-in and guest visitors can both tip.
WeChat PayAlipay
Open WeChat or Alipay and scan. No login required.
Add Tag
Enter tag name (max 50 characters)
Share E-Book
你不知道的JavaScript(下卷) ([美] Kyle Simpson)(Z-Library)
Scan QR code with your phone to access
Copy the link or scan the QR code to access this e-book on your phone
Share E-Book via Email
Please enter email address
Donation Statistics
¥.00
Total Donations
0
Donation Count
你不知道的JavaScript(下卷) ([美] Kyle Simpson)(Z-Library)
Find Your Favorite Books
Only registered users can comment after logging in. Comments need to be reviewed by administrators before being displayed
Loading comments...
Reply to Comment
Edit Comment