"The Variable Crimes We Commit Against JavaScript"
summary
Demonstrates how JavaScript scope and hoisting change real code: assigning magenta without var leaks to window while var creates function-scoped variables and makes rouge local; hoisting turns a later var terracotta into undefined at runtime; a marmalade closure keeps an internal counter that returns false false true across calls; objects and arrays copy by reference so bumblebee mutates canary, slice makes a shallow copy, and let/const create block scope so loop iterators don’t leak. Also covers arrow functions and const’s immutable reference behavior.
AI-written summary · about
chapters (11)
- 0:00Introduction and setup
- 1:26JavaScript scopes explained
- 4:01Var in function scopes
- 10:33Variable hoisting quirks
- 12:44Closures in JavaScript
- 14:13Arrays and objects references
- 17:50ES6 let const and block scope
- 22:31Named vs anonymous functions
- 27:32ES6 arrow functions
- 29:38Summary and resources
- 31:33Q&A session
related talks
32mThe Variable Crimes We Commit Against JavaScript
55mJavaScript the Grumpy Parts
01h 14mJavaScript the Grumpy Parts
33mYou and the Temporal Dead Zone, ES6 Variables For Fun and Profit
57mJavascript The Fascinating Parts
44mThings that every JavaScript developer should know
01h 01mRediscovering JavaScript
41mJavaScript is Weird. MythBusters Special
