Tell us what’s happening:
this is what the console is logging:
[ 3, 4, 5, 6, 7, 8, 9, 10 ]
[ 3, 4, 5, 6, 7, 8, 9, 10 ]
so why is the test telling me that arr is not a subarray of source with [ 3, 4, 5, 6, 7, 8, 9, 10 ]
Your code so far
const source = [1,2,3,4,5,6,7,8,9,10];
function removeFirstTwo(list) {
"use strict";
// Only change code below this line
list = source;
const [, , ...arr] = list; // Change this line
// Only change code above this line
console.log(arr);
return arr;
}
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/81.0.4044.138 Safari/537.36
.
Challenge: Use Destructuring Assignment with the Rest Parameter to Reassign Array Elements
Link to the challenge: