转换规则:
Undefined->false
Null->false
Boolean->返回参数值
Number->当参数为+0、-0或NaN时返回false,其他情况返回true
String->当参数为空字符串时(字符串长度为0),返回false,其他情况返回true
Symbol->true
Object->true
| Argument Type | Result |
|---|---|
| Undefined | Return false. |
| Null | Return false. |
| Boolean | Return argument. |
| Number | If argument is +0, -0, or NaN, return false; otherwise return true. |
| String | If argument is the empty String (its length is zero), return false; otherwise return true. |
| Symbol | Return true. |
| Object | Return true. |