I'm trying to shorten out the following code:
var a = 0, b = 0;
function() {
return a === 0 && b === 0; // returns 'true'
}
So, I thought something like the following would do:
var a = 0, b = 0;
function() {
return a === b === 0; // returns 'false'
}
Initially, I thought that such syntax would throw an error, but apparently it returns false
. Why does a === b === 0
return false
?