* chore(i8n,learn): processed translations * Update curriculum/challenges/chinese/01-responsive-web-design/applied-visual-design/use-the-u-tag-to-underline-text.md Co-authored-by: Randell Dawson <5313213+RandellDawson@users.noreply.github.com> Co-authored-by: Crowdin Bot <support+bot@crowdin.com> Co-authored-by: Nicholas Carrigan (he/him) <nhcarrigan@gmail.com> Co-authored-by: Randell Dawson <5313213+RandellDawson@users.noreply.github.com>
1.6 KiB
1.6 KiB
id, title, challengeType, videoUrl, forumTopicId, dashedName
id | title | challengeType | videoUrl | forumTopicId | dashedName |
---|---|---|---|---|---|
56533eb9ac21ba0edf2244ed | Agrega variables a cadenas | 1 | https://scrimba.com/c/cbQmZfa | 16656 | appending-variables-to-strings |
--description--
Al igual que podemos construir una cadena sobre múltiples líneas a partir de las cadenas literales, también podemos añadir variables a una cadena usando el operador "más igual" (+=
).
Ejemplo:
var anAdjective = "awesome!";
var ourStr = "freeCodeCamp is ";
ourStr += anAdjective;
ourStr
tendrá el valor de freeCodeCamp is awesome!
.
--instructions--
Establece someAdjective
a una cadena de al menos 3 caracteres y añádelo a myStr
usando el operador +=
.
--hints--
someAdjective
debe ser establecido a una cadena de al menos 3 caracteres.
assert(typeof someAdjective !== 'undefined' && someAdjective.length > 2);
Debes añadir someAdjective
a myStr
usando el operador +=
.
assert(code.match(/myStr\s*\+=\s*someAdjective\s*/).length > 0);
--seed--
--after-user-code--
(function(){
var output = [];
if(typeof someAdjective === 'string') {
output.push('someAdjective = "' + someAdjective + '"');
} else {
output.push('someAdjective is not a string');
}
if(typeof myStr === 'string') {
output.push('myStr = "' + myStr + '"');
} else {
output.push('myStr is not a string');
}
return output.join('\n');
})();
--seed-contents--
// Change code below this line
var someAdjective;
var myStr = "Learning to code is ";
--solutions--
var someAdjective = "neat";
var myStr = "Learning to code is ";
myStr += someAdjective;