Truthiness, falsiness and other JavaScript gotchas
summary
Covers concrete JS pitfalls: loose typing and type coercion cause == vs === surprises (1 + "2" + 3 → "123" or 1 + 2 + "3" → "33"), about 30% of bugs trace to coercion, the arguments object is not an Array so common for-loops return wrong values, parseInt without a radix treats leading zeros as octal, Math.max/min seed with ±Infinity, Number.MIN_VALUE is the smallest positive number, and floating-point math (0.1 + 0.2 !== 0.3) demands tolerant comparisons or integer math.
AI-written summary · about








