ES6 array deconstruction

problem description

assign an array of elements to the variable, but the larger subscript is deconstructed with es6

related codes

// :
let item = array[10];

how to rewrite it with the method of es6 deconstruction? you can"t write it like this. If the subscript is 100jue 1000.

let [,,,,,,,,,item] = array;

solution

Es6
Jun.16,2021

feels like there are no scenarios that use a lot of deconstruction.


what you said. Is this deconstruction?
I don't know what you're going to do, but that's not how deconstruction works.
let a = [1meme 2meme 3meme 4];
let b = [5meme 6meme 7pence8rem .a]; / b is [5pje 6je 7je 8jue 2je 2je 4]

Menu