Tell us what’s happening:
I tried to use this resolution to the exercise " Use the Spread Operator to Evaluate Arrays In-Place" but it wasn’t accept, do you know why, the console output is the same than the suggested resolution.
Your code so far
const arr1 = ['JAN', 'FEB', 'MAR', 'APR', 'MAY'];
let arr2;
arr2 = [];
arr2.push(...arr1) // Change this line
console.log(arr2);
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36
Challenge: ES6 - Use the Spread Operator to Evaluate Arrays In-Place
Honestly, I don’t see why people have to guess the syntax here. The only hint they get is the “in an array literal” part of the last section.
I realize showing the syntax is the same as (almost) showing the solution but this isn’t a puzzle, it is documentation for how it works. Show how it works, then have people use it in some other context.