“array destrukturisasi mdn” Kode Jawaban

Array Destructuring 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 destrukturisasi mdn

eslint use array destructuring
Panicky Partridge

Jawaban yang mirip dengan “array destrukturisasi mdn”

Pertanyaan yang mirip dengan “array destrukturisasi mdn”

Lebih banyak jawaban terkait untuk “array destrukturisasi mdn” di JavaScript

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya