Oh My Dear JavaScript
Bizarre behaviors in JavaScriptRelational and Equality Operators
Operators are ordered by strictness, top most.nullundefinedfalse"false"Boolean(false)[][[]]""String("")0Number(0)"0"String("0")[0]true"true"Boolean(true)1Number(1)"1"String("1")[1]-1Number(-1)"-1"String("-1")[-1]Infinity-InfinityObject()NaNnullundefinedfalse"false"Boolean(false)[][[]]""String("")0Number(0)"0"String("0")[0]true"true"Boolean(true)1Number(1)"1"String("1")[1]-1Number(-1)"-1"String("-1")[-1]Infinity-InfinityObject()NaN=====>= && <=>=<=else
What goes through If statement
# Because strait is the gate, and narrow is the way nullundefinedfalse"false"Boolean(false)[][[]]""String("")0Number(0)"0"String("0")[0]true"true"Boolean(true)1Number(1)"1"String("1")[1]-1Number(-1)"-1"String("-1")[-1]Infinity-InfinityObject()NaNwhat goes through ifwhat equals (==) truewhat equals (==) false© 2016
Thomas Yang