![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhjKikw1PLGDhHYKxzl_PACcx4u99kG4jsGSnpH7LR-30Xi0jJfWFI11eazApB_WXAJ-Kfrkz_qajIWljXhalXVVbXqysa69QvWRdY9I_UNk4X5E6T7K8inagI7sIPBCEu5ukTd1cXxmZs/s400/let+variable+in+javascript.jpeg)
What are the "let" variables in JavaScript ?
These variables are limited to relevant scope.It means we can't use these variables outside of scope. But var variables are global variables in java script.
ex :
function(){
let status=5;
console.log(status);
}
console.log(status);
The status variable is valid only for scope of function.It can't be used in outside.let status=5;
console.log(status);
}
console.log(status);
No comments:
Post a Comment