The following shows that "0"
is false in Javascript:
>>> "0" == false
true
>>> false == "0"
true
So why does the following print "ha"
?
>>> if ("0") console.log("ha")
ha
The following shows that "0"
is false in Javascript:
>>> "0" == false
true
>>> false == "0"
true
So why does the following print "ha"
?
>>> if ("0") console.log("ha")
ha