Website Developer Question:
Download Job Interview Questions and Answers PDF
Tell me how Do You Distinguish Between An Undefined And Undeclared Variable?
Answer:
Undefined refers to a variable which has declaration but not initialized yet. However, an undeclared variable is one which has a reference in the code without being declared.
Example.
var iExistButUndefined;
alert(iExistButUndefined); // undefined
alert(iMNotDeclared); // accessing an undeclared variable
Example.
var iExistButUndefined;
alert(iExistButUndefined); // undefined
alert(iMNotDeclared); // accessing an undeclared variable
Download Website Developer Interview Questions And Answers
PDF
Previous Question | Next Question |
Tell me what is CORS? How does it work? | Tell me what Is The Difference Between Undefined Value And Null Value? |