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

21 lines
591 B
Markdown
Raw Normal View History

2018-10-12 19:37:13 +00:00
---
title: Combine Arrays with the Spread Operator
localeTitle: Combina matrices con el operador de propagación
---
## Combina matrices con el operador de propagación
* La solución es exactamente igual al ejemplo dado. Simplemente inserte la matriz del `fragment[]` en la matriz de la `sentence[]` en el índice deseado.
## Solución:
```javascript
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());
```