- 1

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

18th Jan 2017, 3:41 AM
Mo'men Mohamed
Mo'men Mohamed - avatar
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
18th Jan 2017, 8:19 AM
visph
visph - avatar
0
Thanks visph
19th Jan 2017, 12:37 AM
Mo'men Mohamed
Mo'men Mohamed - avatar
0
Yes guys
3rd Feb 2017, 8:44 PM
habib ibrahim
0
Thanks so much
3rd Feb 2017, 8:44 PM
habib ibrahim
- 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
3rd Dec 2017, 5:03 PM
kalai vani
kalai vani - avatar