- 1
What is the difference between undefined and not defined in JavaScript?
5 Antworten
+ 3
Undefined: variable was declared ( with the statement-keyword 'var' ), but not assigned with a value.
Not defined: variable does'nt have been declared at all...
Declaration without assignement:
var my_var;
Assignement:
my_var = 5;
Declaration and assignement:
var my_var = 5
0
Thanks visph
0
Yes guys
0
Thanks so much
- 1
var x;
console.log(x);
console.log(y);
1.The o/p for console.log(x) will be: undefined(Declaration without defined)
2.The o/p for console.log(y) will be: not defined