The values for Flase are:
False0
All but the above are ture, including "0" (zero in quotes), "false" (false in quotes) , empty functions, [] (empty array), and {} ( Empty objects), are all true
var a =!! (0); Falsevar B =!! ("0"); True
A comparison between types that are false:
false , 0 (zero), and "" (empty string) These three are all equal to "= ="
var c = (false = = 0); Truevar D = (false = = ""); True var e = (0 = = ""); True
NULL and the undefined is equal to, except for themselves, "= =" compared to other values.
var F = (Null = = False); False var g = (Null = = NULL);//True var h = (undefined = = undefined);//Truevar i = (undefined = = null);// True
There's a special Nan, and he's not equal to any of the values.
var j = (NaN = = null); False var k = (Nan = = nan); //False
typeof (NaN) returns the "number", generally we use IsNaN () to determine whether a value is NaN
Above, if the use of "= = =" Strictly congruent and "!==" strict unequal, the situation is not quite the same, the two comparisons are included in the type and value
var L = (false = = 0); Truevar m = (false = = = 0); False
Two applicable methods are attached:
1. Check if an empty array is bit
var n = ([].length = = 0) //Ture
2. Check if a bit empty object
var obj = {};for (var i in obj) { if (Obj[i]) { return true; } else { return false;} }