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

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


Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/ Safari/537.36

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

Link to the challenge:

You need to change this one line.

They aren’t looking for you to make a new line here or use push

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.

@almirjr7 Look at this MDN page

Its a strange challenge for sure.

I opened an issue for it.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.