As per ECMA 5.1 Standards, Truthiness of an expression will be decided, as per the following table
+---------------+-------------------------------------------------------+
| Argument Type | Result |
+---------------+-------------------------------------------------------+
| Undefined | false |
+---------------+-------------------------------------------------------+
| Null | false |
+---------------+-------------------------------------------------------+
| Boolean | The result equals the input argument (no conversion). |
+---------------+-------------------------------------------------------+
| Number | The result is false if the argument is +0, ?0, or NaN;|
| | otherwise the result is true. |
+---------------+-------------------------------------------------------+
| String | The result is false if the argument is the empty |
| | String (its length is zero); otherwise the result is |
| | true. |
+---------------+-------------------------------------------------------+
| Object | true |
+---------------+-------------------------------------------------------+
So, you have missed -0
and NaN
.
console.log(Boolean(-0));
# false
console.log(Boolean(NaN));
# false
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…