Loading…

What are the difference between undefined and not defined in JavaScript?

  undefined Not defined
1. A variable was declared with a keyword "var" but not assigned with a value. A variable have not been declared without assignment:
2. Example :
var a = 1, b;
console.log(a) //1
console.log(b) //undefined
Example :
var a = 1, b;
console.log(f) // not defined

Suggest An Answer

No suggestions avaliable!

Latest post from JavaScript interview questions

Ask Question