I read this in Eloquent JavaScript book:
The rules for converting strings and numbers to Boolean values state that 0, NaN, and the empty string ("") count as false, while all the other values count as true.
Because of this, expressions like 0 == false
and "" == false
are true.
And also following these rules this expression should evaluate to true:
console.log("A" == true)
But it evaluates to false. Why?