Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

what are undeclared and undefined variables in javascript

// what are undeclared and undefined variables in javascript
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.
 
PREVIOUS NEXT
Tagged: #undeclared #undefined #variables #javascript
ADD COMMENT
Topic
Name
9+7 =