Can some tell me why the following code returns true in JavaScript?
console.log(true > null); //returns true
null
is like false
in this case, wich is 0
as a number. true
is 1
as a number.
1
is bigger (>
) than 0
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With