0 votes
389 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 405 views
asked May 15, 2022 in C program by Doubtly (98.9k points)
0 votes
1 answer 420 views
0 votes
1 answer 401 views
asked Aug 9, 2022 in JAVA by Doubtly (98.9k points)
0 votes
1 answer 429 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!

Recent Badges

Doubtly Earned a badge
MrRam Earned a badge
Ritesh Maurya Earned a badge

5.7k questions

5.1k answers

108 comments

648 users

...