4 ms·
null, undefined, NaN, false, 0, '' How did I do?
by Drakim 3y ago
null, undefined, NaN, false, 0, ''
How did I do?
- noman-land 3y agoDon't forget -0.
- pcthrowaway 3y agoThat's just another name for 0
- WorldMaker 3y agoBut 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.
- noman-land 3y agoMDN specifically calls it out. https://developer.mozilla.org/en-US/docs/Glossary/Falsy https://developer.mozilla.org/en-US/docs/Glossary/Falsy
- Drakim 3y ago0 === -0
- noman-land 3y agoMDN specifically calls it out. https://developer.mozilla.org/en-US/docs/Glossary/Falsy https://developer.mozilla.org/en-US/docs/Glossary/Falsy
- Drakim 3y agoHold on the real nugget here is that apparently document.all is a falsy object. Why in the world would that be the case?!?
- noman-land 3y agoI agree! Last time I looked at this page, this was not there.
- Tade0 3y agoPerfectly.
- pcthrowaway 3y agoYou forgot 0n ... I guess you wouldn't pass
- Tade0 3y agoGot 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.
- bakkoting 3y agoIf 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.