Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Boolean object to the table #21

Open
bananpermobil opened this issue Jul 7, 2015 · 1 comment
Open

Add Boolean object to the table #21

bananpermobil opened this issue Jul 7, 2015 · 1 comment

Comments

@bananpermobil
Copy link

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

@Errorname
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants