freeCodeCamp/guide/arabic/certifications/javascript-algorithms-and-d.../basic-data-structures/combine-arrays-with-the-spr.../index.md

19 lines
644 B
Markdown
Raw Normal View History

---
title: Combine Arrays with the Spread Operator
localeTitle: الجمع بين المصفوفات مع المشغل انتشار
---
## الجمع بين المصفوفات مع المشغل انتشار
* الحل هو بالضبط مثل المثال المعطى. ما عليك سوى إدخال المصفوفة `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());
`