Skip to content

Instantly share code, notes, and snippets.

@marcoslin
Created June 21, 2014 12:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marcoslin/b4445ac72293575d21f6 to your computer and use it in GitHub Desktop.
Save marcoslin/b4445ac72293575d21f6 to your computer and use it in GitHub Desktop.
Truthy (b==1 && b==2 & b==3)
var b = {}, priv = 0;
b.valueOf = function () {
return priv += 1;
}
if ( b==1 && b==2 & b==3 ) {
console.log("This can only be true in JS!!!"); // This works!!!
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment