My biggest WTF was when I discovered that parseFloat("Infinity") returns... Infinity itself.
I was working on a site that dealt with English dictionaries, and had a field where you could enter either an English word, OR a number with decimals that represented its frequency. And one day I actually typed in "Infinity" as a test word, and program execution went down a completely unexpected code path... Probably the most surprised I've ever been by a bug.
I was working on a site that dealt with English dictionaries, and had a field where you could enter either an English word, OR a number with decimals that represented its frequency. And one day I actually typed in "Infinity" as a test word, and program execution went down a completely unexpected code path... Probably the most surprised I've ever been by a bug.