What are the false values in JavaScript?

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:

  1. 0
  2. IN
  3. ""or''
  4. null
  5. undefined
  6. 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

insert image description here
Original link: https://blog.csdn.net/Csdn_____c/article/details/122741205

Guess you like

Origin blog.csdn.net/qq_33235680/article/details/126361421