Created
June 21, 2014 12:06
-
-
Save marcoslin/b4445ac72293575d21f6 to your computer and use it in GitHub Desktop.
Truthy (b==1 && b==2 & b==3)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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