There are three ways to declare a JavaScript variable:
We'll discuss the differences in Scope, Redeclaration, and Hoisting.
The var declares a variable with function scope.
var
The let keyword was introduced in ES6 (2015).
The const keyword was introduced in ES6 (2015).