“JavaScript Let” Ответ

Пусть JavaScript

The let statement declares a block-scoped local variable, 
  optionally initializing it to a value.
let x=1;
Real Raccoon

Пусть JavaScript

* Variables defined with let cannot be redeclared.
* You cannot accidentally redeclare a variable.

let x = "John Doe";

let x = 0;

// SyntaxError: 'x' has already been declared
Rht

JavaScript Let

// variable declared using let
let name = 'Sara';
{
    // can be accessed only inside
    let name = 'Peter';

    console.log(name); // Peter
}
console.log(name); // Sara
SAMER SAEID

Ответы похожие на “JavaScript Let”

Вопросы похожие на “JavaScript Let”

Смотреть популярные ответы по языку

Смотреть другие языки программирования