Last active
May 30, 2016 13:44
-
-
Save jancajthaml/2943abfb0d15ac38bb4c741d96382529 to your computer and use it in GitHub Desktop.
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
function exists(e) { | |
return { | |
[false]: false, | |
[void 0]: true | |
}[{ | |
[void 0]: false, | |
[{}]: false, | |
[false]: false, | |
[undefined]: false, | |
[1 / 0]: false | |
}[e]] | |
} | |
var a = '' | |
if (exists[a]) { | |
//is really not null | |
} else { | |
//is null | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment