Web Development · Revision notes

Modern JavaScript (ES6+ & Asynchronous Engine)

ES6+ introduced let/const, arrow functions, destructuring, modules and promises/async-await. Understanding closures, prototypes, the DOM, the call stack, event loop and microtask queue explains how single-threaded JavaScript handles asynchronous work in the browser.

Quick revision

  • var function-scope hoisted undefined; let/const block-scope with TDZ
  • always ===; typeof null is object; NaN !== NaN; 0.1+0.2 float error
  • arrow: lexical this, no arguments/prototype, not for methods
  • closure = function + remembered scope (by reference)
  • destructuring, spread = shallow copy, rest collects
  • map transforms, filter selects, reduce folds (pass initial value)
  • prototype chain lookup; class is sugar over prototypes
  • textContent safe, innerHTML XSS risk; batch DOM writes
Read the full Modern JavaScript (ES6+ & Asynchronous Engine) notes on Doubtclip →