If you attempt to use a variable that does not exist and has not been declared, javascript will throw an error. var name is not defined
, and the script will sto
I believe it's a difference between JavaScript definition and firebugs of the same thing.
Undefined is just the state of something that has not been defined as a value. So it has no type.
Also what is the difference between var a; and var b = undefined;
var a; alert(a); // undefined
a; alert(a); // "Error "a" not defined"
a = undefined; alert(a); // undefined
2nd example is not valid JavaScript code and the execution will stop. Since this is an error.