Classic JS Traps
typeof null === "object" — Historical bug. Check null with: x === null.
NaN !== NaN — NaN is the only value not equal to itself. Use Number.isNaN(x), not x === NaN.
0.1 + 0.2 !== 0.3 — Floating point. Use Math.abs(a - b) < Number.EPSILON for comparison.
Array.sort() is alphabetical by default — [10,9,2].sort() → [10,2,9]. Always pass a comparator: .sort((a,b) => a-b).
var in loops with closures — Use let or capture with IIFE. Classic setTimeout(() => console.log(i)) in var-loops prints max value.
arguments object doesn't exist in arrow functions — Use rest params (...args) instead.
== coercion surprises — [] == false is true. [] == ![] is true. Always use ===.
Object reference equality — {} === {} is false. Objects are equal only if same reference. Use JSON.stringify or deep-equal for comparison.
Async function always returns Promise — Even if you return 42, callers get Promise<42>. You must await it.
Promise executor runs synchronously — The (resolve, reject) callback inside new Promise() runs immediately, before .then(). Only the resolution is async.