JavaScript Gotchas
summary
Covers concrete JavaScript pitfalls: implicit globals from missing var and why use strict prevents them, ES6 let giving true block scope, NaN not equal to itself so use isNaN, and Date parsing returning NaN. Demonstrates numeric limits (Number.MAX_SAFE_INTEGER) that stop incrementing, string+number coercion, + operator quirks, and loop speed: for-in is ~10x slower than indexed loops so cache length for speed. Shows JIT rules: try/catch and >600‑char functions prevent optimization (114ms vs ~2x slower), and closures via event listeners cause persistent memory leaks.
AI-written summary · about
chapters (10)
- 0:00Introduction
- 12:55MathMax
- 13:55Poetry
- 15:48Equals
- 20:00Not a Number
- 25:58Loops
- 29:28Numbers
- 31:58Hot Functions
- 38:58Type Off
- 43:13Memory








