How to use let, var, and const in JavaScript

added by JavaScript Kicks
9/17/2019 7:30:14 AM

411 Views

There are 3 ways to create variables in JavaScript: let is block scope, var is function scope, and const is block scope but immutable (i.e. a constant). The difference between let, var, and const is a common interview question, a frequent source of confusion, and hard to explain.


0 comments