
Asked in Accenture and 23 others
What are the key differences between 'var' and 'let' in JavaScript?

AnswerBot
3d
var is function-scoped, while let is block-scoped, leading to different behaviors in variable accessibility.
Scope: 'var' is function-scoped; 'let' is block-scoped.
Hoisting: 'var' is hoisted and initia...read more
Deepak Vishwakarma
3y
var and let both are used to assign variable.
but there are some different. var defined variable are block level and let are not
Help your peers!
Add answer anonymously...
Interview Questions from Popular Companies

3.7
• 8.7k Interviews

4.0
• 5.4k Interviews

3.5
• 4.2k Interviews

3.6
• 8k Interviews

3.7
• 6k Interviews

3.7
• 6.2k Interviews

3.5
• 4.2k Interviews

3.7
• 5.1k Interviews
Stay ahead in your career. Get AmbitionBox app


Trusted by over 1.5 Crore job seekers to find their right fit company
80 L+
Reviews
10L+
Interviews
4 Cr+
Salaries
1.5 Cr+
Users
Contribute to help millions
AmbitionBox Awards
Get AmbitionBox app

