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

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

#1

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/


#2

You don’t need to use concat here.

Just use the spread operator for arr1 inside your array.