Yikes! There are not five falsey values as I suggest here and here but instead at least six as the Boolean value for false is obviously falsey as it's literally false. This moreover makes a distinction between negative zero and zero and between an empty string defined with single quotes and an empty string defined with double quotes and all four things are falsey. The same thread suggests there is an obscure thing called document.all which is of old IE that is also falsey, so there could be as many as nine falsey shapes.
- undefined
- null
- false
- NaN
- 0
- ""
- ''
- -0
- document.all
No comments:
Post a Comment