Skip to content

Instantly share code, notes, and snippets.

@anubhavsrivastava
Created November 7, 2018 18:54
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anubhavsrivastava/4680a165db9e1abc459c5987e778a674 to your computer and use it in GitHub Desktop.
Save anubhavsrivastava/4680a165db9e1abc459c5987e778a674 to your computer and use it in GitHub Desktop.
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