3 ms·
`2` is truthy, but `==` forces a coercion, which ends up converting Boolean `true` to a number, which is 1 (`ToNumber(true) := 1` [1]), which is ostensibly not
by Xophmeister 12y ago
`2` is truthy, but `==` forces a coercion, which ends up converting Boolean `true` to a number, which is 1 (`ToNumber(true) := 1` [1]), which is ostensibly not equal to 2.
1. http://www.ecma-international.org/ecma-262/5.1/#sec-9.3 http://www.ecma-international.org/ecma-262/5.1/#sec-9.3