--- id: 587d7daa367417b2b2512b6c title: Combine an Array into a String Using the join Method challengeType: 1 videoUrl: '' localeTitle: Combina una matriz en una cadena usando el método de unión --- ## Description
El método de join se utiliza para unir los elementos de una matriz para crear una cadena. Toma un argumento para el delimitador que se usa para separar los elementos de la matriz en la cadena. Aquí hay un ejemplo:
var arr = ["Hola", "Mundo"];
var str = arr.join ("");
// Establece str en "Hello World"
## Instructions
Use el método de join (entre otros) dentro de la función de sentensify para hacer una oración de las palabras en la cadena str . La función debe devolver una cadena. Por ejemplo, "I-like-Star-Wars" se convertiría a "Me gusta Star Wars". Para este desafío, no utilice el método de replace .
## Tests
```yml tests: - text: Su código debe utilizar el método de join . testString: 'assert(code.match(/\.join/g), "Your code should use the join method.");' - text: Su código no debe utilizar el método de replace . testString: 'assert(!code.match(/\.replace/g), "Your code should not use the replace method.");' - text: sentensify("May-the-force-be-with-you") debe devolver una cadena. testString: 'assert(typeof sentensify("May-the-force-be-with-you") === "string", "sentensify("May-the-force-be-with-you") should return a string.");' - text: sentensify("May-the-force-be-with-you") debe devolver "May the force be with you" . testString: 'assert(sentensify("May-the-force-be-with-you") === "May the force be with you", "sentensify("May-the-force-be-with-you") should return "May the force be with you".");' - text: sentensify("The.force.is.strong.with.this.one") debe devolver "The force is strong with this one" . testString: 'assert(sentensify("The.force.is.strong.with.this.one") === "The force is strong with this one", "sentensify("The.force.is.strong.with.this.one") should return "The force is strong with this one".");' - text: 'sentensify("There,has,been,an,awakening") debería volver "There has been an awakening" .' testString: 'assert(sentensify("There,has,been,an,awakening") === "There has been an awakening", "sentensify("There,has,been,an,awakening") should return "There has been an awakening".");' ```
## Challenge Seed
```js function sentensify(str) { // Add your code below this line // Add your code above this line } sentensify("May-the-force-be-with-you"); ```
## Solution
```js // solution required ```