What’s the difference between a variable that is: null, undefined or undeclared? How would you go about checking for any of these states?
Null is absence of memory for particular variable.e.g var a = null;undefined indicate value has not been assign to it.e.g var x; // x is undefinedUndeclared means variable is not declared with any data type.
null is a value of a variable and is a type of object. We use ‘console. log();’ and ‘type of’ to check if a variable is undefined or null. undeclared variables is a variable that has been declared without ‘var’ keyword.