Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

es6 get first and last element of array

let {0 : a ,length : l, [l - 1] : b} = [1,2,3,4,5,6,7,8,9,0];
console.log(a, b)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #element #array
ADD COMMENT
Topic
Name
9+8 =