When ECMAScript 6 (also known as ECMAScript 2015) was released a collection of new APIs, programming patterns and language changes became a standard. Since ES6 started gaining browser and nodejs support developers are wondering if they should stop using the traditional var to declare variables.
ES6 introduced two new ways to declare variables, let and const.

var - has function level scoping and can change the value reference
let - has block level scoping and can change the value reference
const - has block level scoping but cannot change the value reference
Both provide better block scoping that var. const differs from let because the immediate value cannot be changed once it is declared.
Variables declared using var are function scoped, which has led to confusion to many developers as they start using in JavaScript.

#javascript #var #let #const #programming

Declaring A Winner Between JavaScript's var, let And const
1.20 GEEK