Jorge Jesus, Pexels.com
Introduction
Prior to the advent of the ECMAScript 6 standard ( ES6 ) on June 17, 2015, there was only one way to declare a variable in JavaScript: using the var keyword.
From ES6 onward, standards have been identified with the year of their finalization. For example, ES6 was also known as ES2015 . Successive standards have been named in the same way—e.g. ES2016 , ES2017 , etc.
The var keyword, in earlier standards of JavaScript , dating back as far as the first ratified standard in 1997— ECMAScript 1 ( ECMA-262 )—served the purpose of declaring variables in the most flexible manner possible, allowing re-declaration of a variable already declared, and reassignment of values regardless of data type.…