ES6 - Use Destructuring Assignment with the Rest Parameter to Reassign Array Elements

Tell us what’s happening:
Describe your issue in detail here.
What am i doing wrong?
Your code so far

function removeFirstTwo(list) {
  // Only change code below this line
  const [ , , ...arr] = list; // Change this line
  // Only change code above this line
  return arr;
}

const source = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
const sourceWithoutFirstTwo = removeFirstTwo(source);

console.log(sourceWithoutFirstTwo);

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36

Challenge: ES6 - Use Destructuring Assignment with the Rest Parameter to Reassign Array Elements

Link to the challenge:

Why did you change to arr? The instructions didn’t ask you to change that variable’s name.

This really needs to be read and followed.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.