What is the difference between let and var?



What is the difference between let and var?..

Answer / Manish Kumar

In JavaScript, `let` is a block-scoped variable declaration (ES6), which means it's only available within the curly braces. On the other hand, `var` is function-scoped (before ES6), meaning it can be accessed in the entire function or globally if declared outside any function.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More JavaScript Interview Questions

Is null === undefined?

1 Answers  


Is javascript server side or client side?

1 Answers  


Describe briefly the major use of java script on client side

1 Answers  


Explain equality operators in javascript?

1 Answers  


What are JavaScript types?

11 Answers   Infosys, Satyam,


What is the difference between the keywords var and let?

1 Answers  


What are the advantages of using JavaScript?

1 Answers  


what is the need of javascript in the internet

1 Answers  


What do you mean by script?

1 Answers  


How javascript sort function works?

1 Answers  


java is pure object oriented or not?

4 Answers  


hi iM rahul.my questions is my project is a web based & developed using java,jsp. when i record it using qtp what script i will get like either browser("jdfjkf").page("nkf").... or javawindow("f d ").javaedit("Dasf").... plz clarify my doubt asap and i also need some vbscipt of java coding?

1 Answers  


Categories