WTFJS is a hilarious yet insightful collection of JavaScript oddities that’ll make you laugh, cry, and double-check your code.
Think you know JS? Think again.
🔍 Top 3 WTF Moments:
-
[] + []
➝""
➤ Two empty arrays become... an empty string? Thanks, type coercion.
-
typeof NaN
➝"number"
➤ Not a Number is... a number. Classic.
-
[,,,].length
➝3
➤ Three empty slots = an array of length 3 (but good luck iterating it).
These quirks aren't bugs — they’re features.
Explore, laugh, and learn from JS's weird side.
Top comments (0)