We are frequently using the following code pattern in our JavaScript code
if (typeof(some_variable) != \'undefined\' && some_variable != null) {
this is the only case in which == and != should be used:
==
!=
if (val == null) console.log('val is null or undefined')
if (val != null) console.log('val is neither null nor undefined')