Expert Developer JavaScript Question:

What are undeclared and undefined variables?

Tweet Share WhatsApp

Answer:

Undeclared variables are those that do not exist in a program and are not declared. If the program tries to read the value of an undeclared variable, then a runtime error is encountered.

Undefined variables are those that are declared in the program but have not been given any value. If the program tries to read the value of an undefined variable, an undefined value is returned.

Download Expert JavaScript Developer PDF Read All 150 Expert JavaScript Developer Questions
Previous QuestionNext Question
What are JavaScript types?Does JavaScript support automatic type conversion?