ES6 - Destructuring via rest elements

Tell us what’s happening:

I now know the right answer but its not making sense. When you read my code, you can see that I made it similar to the example given. If the example said " [a,b, …arr] = list/or any other word, at least I could work with that. HOW would I learn about using even empty rest syntax ( , , …arr) when you havent told us about it? I hate this so much and I cant wait until im done with fcc.

Your code so far

function removeFirstTwo(list) {
  const [a,b,c,d,e, ...list] = [3, 4, 5] 
  return list;

}

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

removeFirstTwo([1, 2, 3, 4, 5])

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.1.1 Safari/605.1.15

Challenge Information:

ES6 - Destructuring via rest elements

Welcome to the community. A long hard, bump road is awaiting you here at freeCodeCamp.

This is not correct.


At this point in the curriculum, learners are expected to understand that an array literal and a variable holding an array can typically be used the same way.

I know its not correct, I thought to mention this in the post but didn’t think it was needed.
Second, for the second time, the example that was given and the result are not matching.

Im not even gonna bother writing a lengthy explanation. I wish you good luck helping people with basic their problems.

The example and the correct solution do match though? They aren’t a perfect copy-paste of each other but they use the same syntax.

In the next few weeks there will be a new version of the curriculum available, maybe that will be more clear