freeCodeCamp/curriculum/challenges/spanish/02-javascript-algorithms-an.../basic-javascript/declare-string-variables.sp...

64 lines
1.8 KiB
Markdown
Raw Normal View History

2018-10-08 17:34:43 +00:00
---
id: bd7123c9c444eddfaeb5bdef
title: Declare String Variables
challengeType: 1
2018-10-10 20:20:40 +00:00
videoUrl: ''
localeTitle: Declarar variables de cadena
2018-10-08 17:34:43 +00:00
---
## Description
2018-10-10 20:20:40 +00:00
<section id="description"> Anteriormente hemos utilizado el código <code>var myName = &quot;your name&quot;;</code> <code>&quot;your name&quot;</code> se llama una <dfn>cadena</dfn> <dfn>literal</dfn> . Es una cadena porque es una serie de cero o más caracteres entre comillas simples o dobles. </section>
2018-10-08 17:34:43 +00:00
## Instructions
2018-10-10 20:20:40 +00:00
<section id="instructions"> Cree dos nuevas variables de <code>string</code> : <code>myFirstName</code> y <code>myLastName</code> y asigne los valores de su nombre y apellido, respectivamente. </section>
2018-10-08 17:34:43 +00:00
## Tests
<section id='tests'>
```yml
tests:
- text: <code>myFirstName</code> debe ser una cadena con al menos un carácter.
testString: 'assert((function(){if(typeof myFirstName !== "undefined" && typeof myFirstName === "string" && myFirstName.length > 0){return true;}else{return false;}})(), "<code>myFirstName</code> should be a string with at least one character in it.");'
- text: <code>myLastName</code> debe ser una cadena con al menos un carácter.
testString: 'assert((function(){if(typeof myLastName !== "undefined" && typeof myLastName === "string" && myLastName.length > 0){return true;}else{return false;}})(), "<code>myLastName</code> should be a string with at least one character in it.");'
```
</section>
## Challenge Seed
<section id='challengeSeed'>
<div id='js-seed'>
```js
// Example
var firstName = "Alan";
var lastName = "Turing";
// Only change code below this line
```
</div>
### After Test
<div id='js-teardown'>
```js
console.info('after the test');
```
</div>
</section>
## Solution
<section id='solution'>
```js
2018-10-10 20:20:40 +00:00
// solution required
2018-10-08 17:34:43 +00:00
```
</section>