If I have a declaration as follows:
var j;
does j==null until I set it equal to something?
No, it has the default value of undefined
But if want to use the !j condition, it will work with both the values (i.e. undefined or null)
Note that (j==null) is true, but (j===null) is false... JavaScript have "falsy" values and sometimes unexpected rules to convert values, plus fancy === operator to compare value and type at the same time.
null and undefined, they are similar but different.
j==nullwill betrue, but not becausejisnull. Instead it's becausejisundefined, but the==operator does type coercion. The==considersnullandundefinedto be equal. The===operator is strict, and doesn't do any coercion.