3 ms·Unless you’re testing if something is null or undefined, in which case a single “x != null” handles it.by hellcow 3y agoUnless you’re testing if something is null or undefined, in which case a single “x != null” handles it.fzzzy 3y agoSure. I usually just use !x for that.SamBam 3y agoThat doesn't test if it's null or undefined, that just tests if it's not falsy. x = 0; !x → true y = ""; !y → true z = null; !z → true