JS-Boolean
Boolean Values
The following values convert to and therefore work like false:

All other values,including all objects(and arrays) convert to and work like true.
You can test explicitly to see if a is non-null with an if statement like this
if(a!==null)...
and you can test to see if a is falsy or truthy value
if(a)...
In the first case, the body of the if will be executed only if a is not null.The second case if less strict:it will execute the body of the if only if a is not false or any falsy value.