How to know which values represent false in js, we only need to use a common function Booealn() to solve it.
Common false values are:
- 0
- IN
- ""or''
- null
- undefined
- Both false
[] and {} are truth values represented
Here false itself is a Boolean type, while the other 5 are not. Except for these 6, others are "true", including objects, arrays, regular expressions, functions, etc. Note that
'0', 'null', 'false', {}, [] are also true values and the results are as follows
Original link: https://blog.csdn.net/Csdn_____c/article/details/122741205