freeCodeCamp/guide/russian/certifications/javascript-algorithms-and-data-structures/basic-data-structures/combine-arrays-with-the-spread-operator/index.md
2018-10-16 21:32:40 +05:30

744 B
Raw Blame History

title localeTitle
Combine Arrays with the Spread Operator Объединить массивы с оператором распространения

Объединить массивы с оператором распространения

  • Решение в точности соответствует приведенному примеру. Просто вставьте массив fragment[] массив sentence[] в нужном индексе.

Решение:

function spreadOut() { 
  let fragment = ['to', 'code']; 
  let sentence = ["learning", ...fragment, "is", "fun"]; // change this line 
  return sentence; 
 } 
 
 // do not change code below this line 
 console.log(spreadOut());