Open bananpermobil opened 9 years ago
I think this can be explained with the following sentence from the Mozilla Javascript Reference
Do not confuse the primitive Boolean values true and false with the true and false values of the Boolean object.
new Boolean(true)
has a value of true
but it's not the same value as the primitive boolean value true
Therefore, it's not strictly equal
The Boolean object seem to get cast when using == but not when using ===.
ex. new Boolean(true) == true // -> true new Boolean(true) === true // -> false new Boolean(false) == false // -> true new Boolean(false) === false // -> false