Tell us what’s happening:
removeFirstTwo([1, 2, 3, 4, 5])
should be
[3, 4, 5]
Your code so far
function removeFirstTwo(list) {
return list;
}
const [...list] = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
const sourceWithoutFirstTw = list.splice(5, 6);
const sourceWithoutFirstTwo = removeFirstTwo([...list]);
console.log(sourceWithoutFirstTwo);
console.log(list.splice(2, 3));
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/117.0.0.0 Safari/537.36
Challenge: ES6 - Destructuring via rest elements
Link to the challenge: