Link Search Menu Expand Document

Combine Arrays with the Spread Operator

Summary

  • The spread operator can be used to combine arrays.

Final Code

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

console.log(spreadOut());