Aryan PrajapatKnowledge Contributor
What is the difference between let and var in js?
What is the difference between let and var in js?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Questions | Answers | Discussions | Knowledge sharing | Communities & more.
var
1.It has been available from the beginning of JavaScript I
2.It has function scope
3.Variable declaration will be hoisted, initialized as undefined
4.It is possible to re-declare the variable in the same scope.
let
1.introduced as part of ES6.
2.It has block scope
3.Hoisted but not initialized
4.It is not possible to re-declare the variable