The void
operator returns undefined
for any argument/expression passed to it. so you can test against the result (actually some minifiers change your code from undefined
to void 0
to save a couple of characters)
For example:
void 0
// undefined
if (variable === void 0) {
// variable is undefined
}