Difference between var, let, const?



Difference between var, let, const?..

Answer / Manoj Kumar Meena

var is function-scoped and has a global scope when not defined within a function. It can be reassigned and does not have block scoping.

let is block-scoped (only accessible within the curly braces) and can be reassigned.

const is block-scoped (only accessible within the curly braces) and cannot be reassigned.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More AngularJS Interview Questions

What is mvc5?

1 Answers  


How can you decrease the digest cycle time?

1 Answers  


Explain angular elements?

1 Answers  


Do you know scope in angularjs?

1 Answers  


What is two way data binding in angularjs?

1 Answers  


How many types of ngmodule?

1 Answers  


What is urlsegment interface in angular 7?

1 Answers  


We already use angular 1, why do we need an angular 2?

1 Answers  


How do you share data between controllers in angularjs?

1 Answers  


What is $emit, $broadcast and $on in AngularJS?

1 Answers  


What is dependency injection (di) in angular?

1 Answers  


How do you exchange data among different modules of your angular js application?

1 Answers  


Categories