... spread operator was used to duplicate arr1."

Tell us what’s happening:
Hello, please explain me how I can pass this. Error is "… spread operator was used to duplicate arr1."

Your code so far


const arr1 = ['JAN', 'FEB', 'MAR', 'APR', 'MAY'];
let arr2;
(function() {
  "use strict";
  arr2 = [].concat(...arr1); // change this line
})();
console.log(arr2);

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36.

Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/es6/use-the-spread-operator-to-evaluate-arrays-in-place/

You don’t need to use concat here.

Just use the spread operator for arr1 inside your array.

1 Like