Computer Science, asked by Anonymous, 7 months ago

what is the difference between a var and a let in JavaScript?
First answer will be the brainliest..........................​

Answers

Answered by yashasp31
1

Answer:

The main difference between let and var is that scope of a variable defined with let is limited to the block in which it is declared while variable declared with var has the global scope. So we can say that var is rather a keyword which defines a variable globally regardless of block scope.

Answered by aryaanand053
0

var and let are both used for variable declaration in javascript but the difference between them is that var is function scoped and let is block scoped.

It can be said that a variable declared with var is defined throughout the program as compared to let.

Similar questions