the string of false "false"
is not true
or false
:
"false" == true // false
"false" == false // false
how is this possible? this does not apply to "true"
. The above results were executed in the chrome console panel.
EDIT
If the above does not evaluate to true then why does the bellow statement print hello:
if("false") console.log("hello")
EDIT2
In the linked duplicate it says "false"
is converted to NaN
. Let's test this in chrome shell:
if(NaN) console.log("hello")
if("false") console.log("hello")
// prints hello
But weirdly enough isNaN("false")
returns true.