DOWN THE RABBIT HOLE: JAVASCRIPT IN WONDERLAND
summary
Covers concrete surprises and hacks: NaN !== NaN and NaN has type Number; Array.sort() treats numbers as strings so numeric arrays need a compare function; the bitwise trick ~~n truncates decimals (faster than Math.floor) and ~indexOf(...) converts -1/>=0 to booleans; old browsers allow undefined to be redefined; demonstrates non‑alphanumeric JavaScript that builds and executes functions (enough to recreate jQuery and once bypass HTML filters on eBay), and explains arrow functions’ lexical this.
AI-written summary · about
chapters (14)
- 0:00Introduction and welcome
- 1:26JavaScript oddities overview
- 3:15NaN and its quirks
- 6:04Lexicographical sorting in JS
- 8:54Custom sorting with compare functions
- 9:39Bitwise not operator hacks
- 13:36For loop flexibility
- 15:01Undefined and global scope
- 16:49Non-alphanumeric JavaScript intro
- 19:42Boolean coercion rules
- 23:58JavaScript Scrabble technique
- 26:50Why learn obscure JS features
- 28:15Arrow functions and context
- 30:24Why JavaScript matters
