--- id: 587d7daa367417b2b2512b6c title: Combine an Array into a String Using the join Method challengeType: 1 videoUrl: '' localeTitle: Combine uma matriz em uma seqüência de caracteres usando o método de associação --- ## Description
O método de join é usado para unir os elementos de uma matriz para criar uma string. É necessário um argumento para o delimitador usado para separar os elementos da matriz na cadeia. Aqui está um exemplo:
var arr = ["Olá", "Mundo"];
var str = arr.join ("");
// Define str como "Hello World"
## Instructions
Use o método join (entre outros) dentro da função sentensify para fazer uma sentença a partir das palavras na string str . A função deve retornar uma string. Por exemplo, "Eu-como-Star-Wars" seria convertido para "Eu gosto de Star Wars". Para este desafio, não use o método replace .
## Tests
```yml tests: - text: Seu código deve usar o método de join . testString: 'assert(code.match(/\.join/g), "Your code should use the join method.");' - text: Seu código não deve usar o método replace . testString: 'assert(!code.match(/\.replace/g), "Your code should not use the replace method.");' - text: sentensify("May-the-force-be-with-you") deve retornar uma string. 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") deve retornar "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") deve retornar "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") deve retornar "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 ```