Instantly share code, notes, and snippets.

Embed
What would you like to do?
Can (a==1 && a==2 && a==3) ever evaluate to true?
const a = { value : 0 };
a.valueOf = function() {
return this.value += 1;
};
console.log(a==1 && a==2 && a==3); //true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment