let numbers = [2, 3, 5, 7, 11];
let first2 = numbers.slice(0, 2);
//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);