- What is
- Difference between the both.
Undefined is simply a Placeholder that is initialise to every variable at the time of memory execution in Global Execution Context.
console.log(a); // undefined
var a = 7; // Assign value 7 to a
console.log(a); // Log --> 7 on Screen
This is like an error, occurs when the code is trying to access the variable that is never been there in memory.
var b = 7; // Assign value 7 to b
console.log(a); // not defined
So, Hope you got to know the simple difference between the two Jargons.
Don't stop learning, Keep exploring and learning.