“Array Destructurant MDN” Réponses codées

Array Destructurant JS

// In an array destructuring from an array of length N specified on the right-hand side of the assignment, if the number of variables specified on the left-hand side of the assignment is greater than N, only the first N variables are assigned values. The values of the remaining variables will be undefined.

const foo = ['one', 'two'];

const [red, yellow, green, blue] = foo;
console.log(red); // "one"
console.log(yellow); // "two"
console.log(green); // undefined
console.log(blue);  //undefined
Ill Iguana

Array Destructurant MDN

eslint use array destructuring
Panicky Partridge

Réponses similaires à “Array Destructurant MDN”

Questions similaires à “Array Destructurant MDN”

Plus de réponses similaires à “Array Destructurant MDN” dans JavaScript

Parcourir les réponses de code populaires par langue

Parcourir d'autres langages de code