Files
2018-10-16 21:32:40 +05:30

591 B

title, localeTitle
title localeTitle
Combine Arrays with the Spread Operator 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:

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());