WTFJS
A list of funny and tricky JavaScript examples
WTFJS is a curated collection of JavaScript “gotchas” and puzzling examples that reveal surprising corners of the language. Each entry presents a small snippet, explains why the behavior occurs, and ties it back to the specification or engine rules. The repository covers coercion quirks, edge-case comparisons, floating-point oddities, prototype traps, and scoping pitfalls, among others. It’s designed as both a fun read and a serious learning aid, helping developers build an intuition for how JavaScript evaluates expressions. By highlighting common misconceptions, it encourages safer coding patterns and more reliable mental models. ...