Skip to content

Instantly share code, notes, and snippets.

@jancajthaml
Last active May 30, 2016 13:44
Show Gist options
  • Save jancajthaml/2943abfb0d15ac38bb4c741d96382529 to your computer and use it in GitHub Desktop.
Save jancajthaml/2943abfb0d15ac38bb4c741d96382529 to your computer and use it in GitHub Desktop.
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