let array = [1,2,3,4,5,6,7,8,9,0]
Documentation is something like this
[first, ...rest] = array
will output 1 and the rest of array
Now is there a way to take only the first and the last element 1 & 0
with Destructuring
ex: [first, ...middle, last] = array
I know how to take the first and last elements the other way but I was wondering if it is possible with es6