ES6 - Destructuring via rest elements

Tell us what’s happening:
Describe your issue in detail here.
I get an error with these two tests

remove First Two([1, 2, 3, 4, 5]) should be [3, 4, 5]

Waiting:remove First Two() should not modify list
Your code so far

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

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

console.log(removeFirstTwo([1, 2, 3, 4, 5]));
console.log(removeFirstTwo());

Your browser information:

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

Challenge: ES6 - Destructuring via rest elements

Link to the challenge:

Get rid of both console.logs. They are throwing the tests off.

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