let
The let variables are mutable i.e. their values can be changed. It works similar to the var keyword with some key differences like scoping which makes it a better option when compared to var.
Example: This example will illustrate how to declare varibale using the let keyword.
javascript
// let let name = 'Mukul' ; console.log(name); // Prints Mukul name = 'Rahul' ; console.log(name); // Prints Rahul // Trying to declare let variable first and then initialise in another line let org_name; org_name = "w3wiki" ; console.log(org_name); // Prints w3wiki |
Mukul Rahul w3wiki
Introduction to ES6
ES6 or ECMAScript 2015 is the 6th version of the ECMAScript programming language. ECMAScript is the standardization of Javascript which was released in 2015 and subsequently renamed as ECMAScript 2015.
ECMAScript and Javascript are both different.