0 votes
134 views
in Javascript by (98.9k points)
edited

What are undeclared and undefined variables?

1 Answer

0 votes
by (98.9k points)
selected by
 
Best 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.

Related questions

0 votes
1 answer 153 views
asked May 15, 2022 in C program by Doubtly (98.9k points)
0 votes
1 answer 158 views
0 votes
1 answer 144 views
asked Aug 9, 2022 in JAVA by Doubtly (98.9k points)
0 votes
1 answer 147 views

Doubtly is an online community for engineering students, offering:

  • Free viva questions PDFs
  • Previous year question papers (PYQs)
  • Academic doubt solutions
  • Expert-guided solutions

Get the pro version for free by logging in!

5.7k questions

5.1k answers

108 comments

563 users

...