Today while reading a blog on JavaScript, I came across the below example which seems odd to me. Please clarify.
As per my JavaScript knowledge !!"0"
results true
But, the below statement result seems odd to me, and even I executed it in console which also returned true
false == "0" //results true
My interpretation of this statement is as below
"0"
is treated as true
, so the above statement can be rewritten as false == true
, which must be resulted as false
, but I am getting true
as result. Please clarify.