Expert Developer JavaScript Question:

What is difference between undefined variable and undeclared variable?

Answer:

► The variable which are declared in the program but not assigned any value yet is called undefined variable while the variable which are not declared in the program is called undeclared variable.
► For Example :
undeclared variable:
<script>
var p;
alert(p); // This will give error because p is undeclared variable.
</script>
? undefined variable
<script>
alert(p); //This will give error because p is undefined.
</script>

Read All 150 Expert JavaScript Developer Questions
Previous QuestionNext Question
How can I set up my own JavaScript error handler?What is escape() function?