Generally, in the following statement structure, you need to determine whether the if branch statement is true or false. The second statement in the while LOOP statement for is like if (boo) {// do something} while (boo) {// do something} the six values in JavaScript are "false". These six values are falsenullundefined0'' (Null String) NaN. Here, false is a boolean type, the other five are not. In addition to these six, all others are "true", including objects, arrays, regular expressions, and functions. Note that '0', 'null', 'false', {}, and [] are also true values. Although these six values are both false, they are not all equal. Console. log (false = null) // falseconsole. log (false = undefined) // falseconsole. log (false = 0) // trueconsole. log (false = '') // trueconsole. log (false = NaN) // false console. log (null = undefined) // trueconsole. log (null = 0) // falseconsole. log (null = '') // falseconsole. log (null = NaN) // false console. log (undefined = 0) // falseconsole. log (undefined = '') // falseconsole. log (undefined = NaN) // false console. log (0 = '') // trueconsole. log (0 = NaN) // false for "=", the preceding conclusion is as follows: false is not only true compared with itself, but also 0, ''is true only when truenull is compared with undefined. In turn, undefined is true only when it is compared with null, and no second 0 is compared with true if it is not set to false, there is also an empty string ''null string'' which is equal to true and false, and there is a number 0.