0
Can we declare below statement in js? This question was asked in interview.
Var undefined ;
6 Answers
0
A variable can be accessed before it's declaration. This concept is called variable hoisting
0
Could you please explain me the use of variable hoisting?
0
Well kid, as a matter of fact, I can. But you can do so yourself. Visit Mozilla Development Network, or just Google it.
0
Thanks bro.
0
my pleasure
0
We can not declare any variable as undefined; example:
var undefined=20;
document.write(undefined);
The output printed will be undefined but not 20; It means the variable declaration is not happening.