In your case use data==null
(which is true ONLY for null and undefined - on second picture focus on rows/columns null-undefined)
function test(data) {_x000D_
if (data != null) {_x000D_
console.log('Data: ', data);_x000D_
}_x000D_
}_x000D_
_x000D_
test(); // the data=undefined_x000D_
test(null); // the data=null_x000D_
test(undefined); // the data=undefined_x000D_
_x000D_
test(0); _x000D_
test(false); _x000D_
test('something');
_x000D_
Here you have all (src):
if
== (its negation !=)
=== (its negation !==)