Testing for Destructuring Assignment with the Rest Operator to Reassign Array Elements doesn't seem to be working

Testing for Destructuring Assignment with the Rest Operator to Reassign Array Elements doesn't seem to be working
0

#1

Tell us what’s happening:
The test doesn’t seem to actually be running. I’m on Chrome and none of the other lessons have reacted like this.

Your code so far


const source = [1,2,3,4,5,6,7,8,9,10];
function removeFirstTwo(list) {
  "use strict";
  // change code below this line
  const [,,...arr] = list; // change this
  // change code above this line
  return arr;
}
const arr = removeFirstTwo(source);
console.log(arr); // should be [3,4,5,6,7,8,9,10]
console.log(source); // should be [1,2,3,4,5,6,7,8,9,10];

Your browser information:

User Agent is: Mozilla/5.0 (X11; CrOS x86_64 10575.58.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36.

Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/es6/use-destructuring-assignment-with-the-rest-operator-to-reassign-array-elements


#2

Hey @carl-parrish,
Try to console.log() your code in browser and you might see your mistake.


#3

hey in your code didn’t defined the array, so if you run your code on browser you get following error
"ReferenceError: arr is not defined
try this

let [,,..arr] = list;

#5

Thank you but I wasn’t looking for the answer to the problem (I solved it when the test began working again). The problem was that the Test suite wouldn’t run. I would click on the button and nothing.