Combine Arrays with the Spread Operator in Data Structures

Tell us what’s happening:
my code not producing what i want to pass the challenge.
Your code so far


function spreadOut() {
let fragment = ['to', 'code'];
let sentence = ["learning", ...fragment, "fun"]; // Change this line
return sentence;
}

console.log(spreadOut());
  **Your browser information:**

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

Challenge: Combine Arrays with the Spread Operator

Link to the challenge:

I think you are missing a small thing:

Modify the function using the spread operator so that it returns the array ['learning', 'to', 'code', 'is', 'fun'] .

Yeah, I got it
I left the string of ‘is’

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