Edit in JSFiddle

var x;
var undefined = 'hello';

// both these checks will work
if (x === void 0) {
    console.log('x is undefined!');
}
// or
if (x == void 0) {
    console.log('x is undefined or null!');
}