ES6: Use the Spread Operator to Evaluate Arrays In-Place problem

OK, I have this code:

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

I get this error: … spread operator was used to duplicate arr1.

You are not using the spread operator.

I think you must use the spread operator to copy the array and not the direct assignment…

Thanks for your replies.

It is great that you solved the challenge, but instead of posting your full working solution, it is best to stay focused on answering the original poster’s question(s) and help guide them with hints and suggestions to solve their own issues with the challenge.

If you want to compare your solution to others, use the Get a hint button on the challenge and there are alternative solutions you can compare yours to. Also, you can probably search older posts using the forum search feature or google the challenge name and find more there.

We are trying to cut back on the number of spoiler solutions found on the forum and instead focus on helping other campers with their questions and definitely not posting full working solutions.

Thank you for understanding.

You must use the spread operator, this solution for challengue:
arr2 = [...arr1]; // change this line