[Solved] How exactly does JavaScipt’s data-type convertion work for “==” operator?
As Crockford says: “The rules by which they do that are complicated and unmemorable.” The spec defines them all in section 11.9.3 (pointed out by @Oriol in a comment to OP). For the two cases you provided: if ( 42 == true ) // false ( Only 1 is true ) if ( “Hello World” … Read more