Массивы и коллекции / Массивы

let numbers = [235711];
let first2 = numbers.slice(02);
//first2 is [ 2, 3 ] 
let last3 = numbers.slice(2, numbers.length);
//last3 is [ 5, 7, 11 ]

//Since ES9 2018
let [first, second, ...other] = numbers;
//first is 2
//second is 3
//other is [ 5, 7, 11 ]

console.log("first2 is", first2);
console.log("last3 is", last3);
console.log("first is", first);
console.log("second is", second);
console.log("other is", other);