Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

null, undefined, NaN, false, 0, ''

How did I do?



Don't forget -0.


0 === -0



Hold on the real nugget here is that apparently document.all is a falsy object. Why in the world would that be the case?!?


I agree! Last time I looked at this page, this was not there.


That's just another name for 0


But a different representation in IEEE 754 floating point. If you were building a JS interpreter it would be important to catch that 0 and -0 are different numbers in memory and to hardware operations.



Perfectly.


You forgot 0n ... I guess you wouldn't pass


Got me there, as I forgot about it, but I also don't expect anyone to always name all of them - as it's just a probe on how broad was the spectrum of errors a person encountered.

Personally I've never had an issue where that would matter, as BigInt is typically used mostly in isolation. Any avenue for errors appears only when types are mixed or used in boolean statements.


If we're being pedantic, you also forgot document.all. Which is in fact an infinite collection of values, because document.all is a different object in every frame.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: