--- id: 56533eb9ac21ba0edf2244b8 title: Concatenating Strings with the Plus Equals Operator challengeType: 1 videoUrl: '' localeTitle: Concatenando cadenas con el operador Plus Equals --- ## Description
También podemos usar el operador += para concatenar una cadena al final de una variable de cadena existente. Esto puede ser muy útil para romper una cadena larga en varias líneas. Nota
Cuidado con los espacios. La concatenación no agrega espacios entre las cadenas concatenadas, por lo que deberá agregarlas usted mismo.
## Instructions
Construya myStr en varias líneas concatenando estas dos cadenas: "This is the first sentence. " y "This is the second sentence." utilizando el operador += . Utilice el operador += similar a como se muestra en el editor. Comience por asignar la primera cadena a myStr , luego agregue la segunda cadena.
## Tests
```yml tests: - text: myStr debe tener un valor de This is the first sentence. This is the second sentence. testString: 'assert(myStr === "This is the first sentence. This is the second sentence.", "myStr should have a value of This is the first sentence. This is the second sentence.");' - text: Usa el operador += para construir myStr testString: 'assert(code.match(/\w\s*\+=\s*[""]/g).length > 1 && code.match(/\w\s*\=\s*[""]/g).length > 1, "Use the += operator to build myStr");' ```
## Challenge Seed
```js // Example var ourStr = "I come first. "; ourStr += "I come second."; // Only change code below this line var myStr; ```
### After Test
```js console.info('after the test'); ```
## Solution
```js // solution required ```