Salesqueen Software Solution

Download Free Estimation Now Click Here
Notifications
Clear all

What are undefined and undeclared variables in JavaScript?

3 Posts
3 Users
0 Reactions
141 Views
Posts: 461
Topic starter
(@dinesha-g)
Reputable Member
Joined: 2 years ago

undefined and undeclared variables in JavaScript

2 Replies
Posts: 52
(@chitravarsha15)
Trusted Member
Joined: 2 years ago

When a variable that hasn't been declared using var, let, or const is attempted to be accessed, the error "undeclared" occurs.

Undefined is the result of a variable being declared with the var, let, or const keywords but not being given a value.

 

 

Reply
Posts: 173
(@princy)
Estimable Member
Joined: 2 years ago

An undefined variable is one that has been declared but has no value.The term "undeclared variable" refers to a variable that is completely absent from the programme

Reply
Share: