DEV Community

Cristiano Leal
Cristiano Leal

Posted on

 

Javascript ES6 - let

The let keyword allows you to declare a variable with block scope.
Example

var x = 10;
// Here x is 10
{
  let x = 2;
  // Here x is 2
}
// Here x is 10
Enter fullscreen mode Exit fullscreen mode

Top comments (0)

⬇️ The only reason people scroll to the bottom...

is because they want to read more. Sign up for an account to bookmark, comment, and react to articles that interest you.