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.
đź”— wtfjs.com
Top comments (0)