Let and const are two new features of ES6, which came out in 2015. Before that, var was the only way to declare a variable. var var can do so many things since the variable declared under var can be scoped globally and locally. Hoisting is a JS way to call a variable/function on top of the scope. With the convenience of scoping and updating a var variable, it is easy to spot when writing small programs.

7m read timeFrom meganslo.medium.com
Post cover image
1 Comment

Sort: