“Javascript let” Réponses codées

Laisser JavaScript

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

Laisser 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

Réponses similaires à “Javascript let”

Questions similaires à “Javascript let”

Parcourir les réponses de code populaires par langue

Parcourir d'autres langages de code