5 ms·
> I guess we’ve messed with the prototype too much, and JavaScript isn’t really convinced it’s still a proper number anymore. You're comparing a literal number
by alistairjcbrown 13y ago
> I guess we’ve messed with the prototype too much, and JavaScript isn’t really convinced it’s still a proper number anymore.
You're comparing a literal number with an object, which are not the same type.
2 === new Number(2)
// => false
2 == new Number(2)
// => true