chore(i8n,learn): processed translations (#41197)
Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
---
|
||||
id: bd7123c9c441eddfaeb4bdef
|
||||
title: Comment Your JavaScript Code
|
||||
title: Comenta tu código de JavaScript
|
||||
challengeType: 1
|
||||
videoUrl: 'https://scrimba.com/c/c7ynnTp'
|
||||
forumTopicId: 16783
|
||||
@ -9,39 +9,39 @@ dashedName: comment-your-javascript-code
|
||||
|
||||
# --description--
|
||||
|
||||
Comments are lines of code that JavaScript will intentionally ignore. Comments are a great way to leave notes to yourself and to other people who will later need to figure out what that code does.
|
||||
Los comentarios son líneas de código que JavaScript ignorará intencionalmente. Los comentarios son una gran manera de dejar notas para ti mismo y a otras personas que más tarde tengan que averiguar qué hace ese código.
|
||||
|
||||
There are two ways to write comments in JavaScript:
|
||||
Hay dos maneras de escribir comentarios en JavaScript:
|
||||
|
||||
Using `//` will tell JavaScript to ignore the remainder of the text on the current line:
|
||||
Usar `//` le dirá a JavaScript que ignore el resto del texto en la línea actual:
|
||||
|
||||
```js
|
||||
// This is an in-line comment.
|
||||
```
|
||||
|
||||
You can make a multi-line comment beginning with `/*` and ending with `*/`:
|
||||
Puedes hacer un comentario multi-línea comenzando con `/*` y terminando con `*/`:
|
||||
|
||||
```js
|
||||
/* This is a
|
||||
multi-line comment */
|
||||
```
|
||||
|
||||
**Best Practice**
|
||||
As you write code, you should regularly add comments to clarify the function of parts of your code. Good commenting can help communicate the intent of your code—both for others *and* for your future self.
|
||||
**Buena práctica**
|
||||
A medida que escribes código, deberías añadir comentarios regularmente para aclarar el funcionamiento de las partes de tu código. Un buen comentario puede ayudar a comunicar la intención de tu código, tanto para otros *como* para tu yo futuro.
|
||||
|
||||
# --instructions--
|
||||
|
||||
Try creating one of each type of comment.
|
||||
Intenta crear un comentario de cada tipo.
|
||||
|
||||
# --hints--
|
||||
|
||||
You should create a `//` style comment that contains at least five letters.
|
||||
Debes crear un comentario de estilo `//` que contenga al menos cinco letras.
|
||||
|
||||
```js
|
||||
assert(code.match(/(\/\/)...../g));
|
||||
```
|
||||
|
||||
You should create a `/* */` style comment that contains at least five letters.
|
||||
Debes crear un comentario de estilo `/* */` que contenga al menos cinco letras.
|
||||
|
||||
```js
|
||||
assert(code.match(/(\/\*)([^\/]{5,})(?=\*\/)/gm));
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
id: 56533eb9ac21ba0edf2244d4
|
||||
title: Comparison with the Greater Than Operator
|
||||
title: Comparación con el operador Mayor que
|
||||
challengeType: 1
|
||||
videoUrl: 'https://scrimba.com/c/cp6GbH4'
|
||||
forumTopicId: 16786
|
||||
@ -9,11 +9,11 @@ dashedName: comparison-with-the-greater-than-operator
|
||||
|
||||
# --description--
|
||||
|
||||
The greater than operator (`>`) compares the values of two numbers. If the number to the left is greater than the number to the right, it returns `true`. Otherwise, it returns `false`.
|
||||
El operador mayor que (`>`) compara los valores de dos números. Si el número a la izquierda es mayor que el número a la derecha, devuelve `true`. De lo contrario, devuelve `false`.
|
||||
|
||||
Like the equality operator, greater than operator will convert data types of values while comparing.
|
||||
Como el operador de igualdad, el operador mayor que convertirá los tipos de datos de valores mientras los compara.
|
||||
|
||||
**Examples**
|
||||
**Ejemplos**
|
||||
|
||||
```js
|
||||
5 > 3 // true
|
||||
@ -24,53 +24,53 @@ Like the equality operator, greater than operator will convert data types of val
|
||||
|
||||
# --instructions--
|
||||
|
||||
Add the greater than operator to the indicated lines so that the return statements make sense.
|
||||
Agrega el operador mayor que a las líneas indicadas para que las declaraciones de devolución tengan sentido.
|
||||
|
||||
# --hints--
|
||||
|
||||
`testGreaterThan(0)` should return "10 or Under"
|
||||
`testGreaterThan(0)` debe devolver "10 or Under"
|
||||
|
||||
```js
|
||||
assert(testGreaterThan(0) === '10 or Under');
|
||||
```
|
||||
|
||||
`testGreaterThan(10)` should return "10 or Under"
|
||||
`testGreaterThan(10)` debe devolver "10 or Under"
|
||||
|
||||
```js
|
||||
assert(testGreaterThan(10) === '10 or Under');
|
||||
```
|
||||
|
||||
`testGreaterThan(11)` should return "Over 10"
|
||||
`testGreaterThan(11)` debe devolver "Over 10"
|
||||
|
||||
```js
|
||||
assert(testGreaterThan(11) === 'Over 10');
|
||||
```
|
||||
|
||||
`testGreaterThan(99)` should return "Over 10"
|
||||
`testGreaterThan(99)` debe devolver "Over 10"
|
||||
|
||||
```js
|
||||
assert(testGreaterThan(99) === 'Over 10');
|
||||
```
|
||||
|
||||
`testGreaterThan(100)` should return "Over 10"
|
||||
`testGreaterThan(100)` debe devolver "Over 10"
|
||||
|
||||
```js
|
||||
assert(testGreaterThan(100) === 'Over 10');
|
||||
```
|
||||
|
||||
`testGreaterThan(101)` should return "Over 100"
|
||||
`testGreaterThan(101)` debe devolver "Over 100"
|
||||
|
||||
```js
|
||||
assert(testGreaterThan(101) === 'Over 100');
|
||||
```
|
||||
|
||||
`testGreaterThan(150)` should return "Over 100"
|
||||
`testGreaterThan(150)` debe devolver"Over 100"
|
||||
|
||||
```js
|
||||
assert(testGreaterThan(150) === 'Over 100');
|
||||
```
|
||||
|
||||
You should use the `>` operator at least twice
|
||||
Debes usar el operador `>` por lo menos dos veces
|
||||
|
||||
```js
|
||||
assert(code.match(/val\s*>\s*('|")*\d+('|")*/g).length > 1);
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
id: 56533eb9ac21ba0edf2244af
|
||||
title: Compound Assignment With Augmented Addition
|
||||
title: Asignación compuesta con adición aumentada
|
||||
challengeType: 1
|
||||
videoUrl: 'https://scrimba.com/c/cDR6LCb'
|
||||
forumTopicId: 16661
|
||||
@ -9,13 +9,13 @@ dashedName: compound-assignment-with-augmented-addition
|
||||
|
||||
# --description--
|
||||
|
||||
In programming, it is common to use assignments to modify the contents of a variable. Remember that everything to the right of the equals sign is evaluated first, so we can say:
|
||||
En la programación, es común utilizar asignaciones para modificar el contenido de una variable. Recuerda que todo lo que está a la derecha del signo de igualdad se evalúa primero, así que podemos decir:
|
||||
|
||||
`myVar = myVar + 5;`
|
||||
|
||||
to add `5` to `myVar`. Since this is such a common pattern, there are operators which do both a mathematical operation and assignment in one step.
|
||||
para sumar `5` a `myVar`. Dado que se trata de un patrón tan común, hay operadores que hacen tanto la operación matemática como la asignación en un solo paso.
|
||||
|
||||
One such operator is the `+=` operator.
|
||||
Uno de estos operadores es el operador `+=`.
|
||||
|
||||
```js
|
||||
var myVar = 1;
|
||||
@ -25,35 +25,35 @@ console.log(myVar); // Returns 6
|
||||
|
||||
# --instructions--
|
||||
|
||||
Convert the assignments for `a`, `b`, and `c` to use the `+=` operator.
|
||||
Convierte las asignaciones de `a`, `b` y `c` para que utilicen el operador `+=`.
|
||||
|
||||
# --hints--
|
||||
|
||||
`a` should equal `15`.
|
||||
`a` debe ser igual a `15`.
|
||||
|
||||
```js
|
||||
assert(a === 15);
|
||||
```
|
||||
|
||||
`b` should equal `26`.
|
||||
`b` debe ser igual a `26`.
|
||||
|
||||
```js
|
||||
assert(b === 26);
|
||||
```
|
||||
|
||||
`c` should equal `19`.
|
||||
`c` debe ser igual a `19`.
|
||||
|
||||
```js
|
||||
assert(c === 19);
|
||||
```
|
||||
|
||||
You should use the `+=` operator for each variable.
|
||||
Debes usar el operador `+=` para cada variable.
|
||||
|
||||
```js
|
||||
assert(code.match(/\+=/g).length === 3);
|
||||
```
|
||||
|
||||
You should not modify the code above the specified comment.
|
||||
No debes modificar el código por encima del comentario especificado.
|
||||
|
||||
```js
|
||||
assert(
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
id: 56533eb9ac21ba0edf2244b1
|
||||
title: Compound Assignment With Augmented Multiplication
|
||||
title: Asignación compuesta con multiplicación aumentada
|
||||
challengeType: 1
|
||||
videoUrl: 'https://scrimba.com/c/c83vrfa'
|
||||
forumTopicId: 16662
|
||||
@ -9,45 +9,45 @@ dashedName: compound-assignment-with-augmented-multiplication
|
||||
|
||||
# --description--
|
||||
|
||||
The `*=` operator multiplies a variable by a number.
|
||||
El operador `*=` multiplica una variable por un número.
|
||||
|
||||
`myVar = myVar * 5;`
|
||||
|
||||
will multiply `myVar` by `5`. This can be rewritten as:
|
||||
multiplicará `myVar` por `5`. Esto se puede reescribir como:
|
||||
|
||||
`myVar *= 5;`
|
||||
|
||||
# --instructions--
|
||||
|
||||
Convert the assignments for `a`, `b`, and `c` to use the `*=` operator.
|
||||
Convierte las asignaciones de `a`, `b` y `c` para que utilicen el operador `*=`.
|
||||
|
||||
# --hints--
|
||||
|
||||
`a` should equal `25`.
|
||||
`a` debe ser igual a `25`.
|
||||
|
||||
```js
|
||||
assert(a === 25);
|
||||
```
|
||||
|
||||
`b` should equal `36`.
|
||||
`b` debe ser igual a `36`.
|
||||
|
||||
```js
|
||||
assert(b === 36);
|
||||
```
|
||||
|
||||
`c` should equal `46`.
|
||||
`c` debe ser igual a `46`.
|
||||
|
||||
```js
|
||||
assert(c === 46);
|
||||
```
|
||||
|
||||
You should use the `*=` operator for each variable.
|
||||
Debes usar el operador `*=` para cada variable.
|
||||
|
||||
```js
|
||||
assert(code.match(/\*=/g).length === 3);
|
||||
```
|
||||
|
||||
You should not modify the code above the specified comment.
|
||||
No debes modificar el código por encima del comentario especificado.
|
||||
|
||||
```js
|
||||
assert(
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
id: 56533eb9ac21ba0edf2244b0
|
||||
title: Compound Assignment With Augmented Subtraction
|
||||
title: Asignación compuesta con resta aumentada
|
||||
challengeType: 1
|
||||
videoUrl: 'https://scrimba.com/c/c2Qv7AV'
|
||||
forumTopicId: 16660
|
||||
@ -9,45 +9,45 @@ dashedName: compound-assignment-with-augmented-subtraction
|
||||
|
||||
# --description--
|
||||
|
||||
Like the `+=` operator, `-=` subtracts a number from a variable.
|
||||
Al igual que el operador `+=`, `-=` resta un número de una variable.
|
||||
|
||||
`myVar = myVar - 5;`
|
||||
|
||||
will subtract `5` from `myVar`. This can be rewritten as:
|
||||
restará `5` de `myVar`. Esto se puede reescribir como:
|
||||
|
||||
`myVar -= 5;`
|
||||
|
||||
# --instructions--
|
||||
|
||||
Convert the assignments for `a`, `b`, and `c` to use the `-=` operator.
|
||||
Convierte las asignaciones de `a`, `b` y `c` para que utilicen el operador `-=`.
|
||||
|
||||
# --hints--
|
||||
|
||||
`a` should equal `5`.
|
||||
`a` debe ser igual a `5`.
|
||||
|
||||
```js
|
||||
assert(a === 5);
|
||||
```
|
||||
|
||||
`b` should equal `-6`.
|
||||
`b` debe ser igual a `-6`.
|
||||
|
||||
```js
|
||||
assert(b === -6);
|
||||
```
|
||||
|
||||
`c` should equal `2`.
|
||||
`c` debe ser igual a `2`.
|
||||
|
||||
```js
|
||||
assert(c === 2);
|
||||
```
|
||||
|
||||
You should use the `-=` operator for each variable.
|
||||
Debes usar el operador `-=` para cada variable.
|
||||
|
||||
```js
|
||||
assert(code.match(/-=/g).length === 3);
|
||||
```
|
||||
|
||||
You should not modify the code above the specified comment.
|
||||
No debes modificar el código por encima del comentario especificado.
|
||||
|
||||
```js
|
||||
assert(
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
id: cf1391c1c11feddfaeb4bdef
|
||||
title: Create Decimal Numbers with JavaScript
|
||||
title: Crea números decimales con JavaScript
|
||||
challengeType: 1
|
||||
videoUrl: 'https://scrimba.com/c/ca8GEuW'
|
||||
forumTopicId: 16826
|
||||
@ -9,24 +9,24 @@ dashedName: create-decimal-numbers-with-javascript
|
||||
|
||||
# --description--
|
||||
|
||||
We can store decimal numbers in variables too. Decimal numbers are sometimes referred to as <dfn>floating point</dfn> numbers or <dfn>floats</dfn>.
|
||||
También podemos almacenar números decimales en variables. Los números decimales a veces se denominan números de <dfn>coma flotante</dfn> o <dfn>flotantes</dfn>.
|
||||
|
||||
**Note**
|
||||
Not all real numbers can accurately be represented in <dfn>floating point</dfn>. This can lead to rounding errors. [Details Here](https://en.wikipedia.org/wiki/Floating_point#Accuracy_problems).
|
||||
**Nota**
|
||||
No todos los números reales pueden representarse con precisión en <dfn>coma flotante</dfn>. Esto puede llevar a errores de redondeo. [Detalles aquí](https://en.wikipedia.org/wiki/Floating_point#Accuracy_problems).
|
||||
|
||||
# --instructions--
|
||||
|
||||
Create a variable `myDecimal` and give it a decimal value with a fractional part (e.g. `5.7`).
|
||||
Crea una variable `myDecimal` y dale un valor decimal con una parte fraccional (por ejemplo, `5.7`).
|
||||
|
||||
# --hints--
|
||||
|
||||
`myDecimal` should be a number.
|
||||
`myDecimal` debe ser un número.
|
||||
|
||||
```js
|
||||
assert(typeof myDecimal === 'number');
|
||||
```
|
||||
|
||||
`myDecimal` should have a decimal point
|
||||
`myDecimal` debe tener un punto decimal
|
||||
|
||||
```js
|
||||
assert(myDecimal % 1 != 0);
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
id: bd7123c9c443eddfaeb5bdef
|
||||
title: Declare JavaScript Variables
|
||||
title: Declara variables de JavaScript
|
||||
challengeType: 1
|
||||
videoUrl: 'https://scrimba.com/c/cNanrHq'
|
||||
forumTopicId: 17556
|
||||
@ -9,32 +9,32 @@ dashedName: declare-javascript-variables
|
||||
|
||||
# --description--
|
||||
|
||||
In computer science, <dfn>data</dfn> is anything that is meaningful to the computer. JavaScript provides eight different <dfn>data types</dfn> which are `undefined`, `null`, `boolean`, `string`, `symbol`, `bigint`, `number`, and `object`.
|
||||
En informática, los <dfn>datos</dfn> son cualquier cosa que tenga sentido para la computadora. JavaScript proporciona ocho <dfn>tipos de datos</dfn> diferentes, los cuales son `undefined`, `null`, `boolean`, `string`, `symbol`, `bigint`, `number`, y `object`.
|
||||
|
||||
For example, computers distinguish between numbers, such as the number `12`, and `strings`, such as `"12"`, `"dog"`, or `"123 cats"`, which are collections of characters. Computers can perform mathematical operations on a number, but not on a string.
|
||||
Por ejemplo, las computadoras distinguen entre números, como el número `12` y cadenas (`strings`), tales como `"12"`, `"dog"`, o `"123 cats"`, que son colecciones de caracteres. Las computadoras pueden realizar operaciones matemáticas en un número, pero no en una cadena.
|
||||
|
||||
<dfn>Variables</dfn> allow computers to store and manipulate data in a dynamic fashion. They do this by using a "label" to point to the data rather than using the data itself. Any of the eight data types may be stored in a variable.
|
||||
Las <dfn>variables</dfn> permiten a los ordenadores almacenar y manipular datos de forma dinámica. Hacen esto usando una "etiqueta" para apuntar a los datos en lugar de usar los datos en sí. Cualquiera de los ocho tipos de datos puede almacenarse en una variable.
|
||||
|
||||
`Variables` are similar to the x and y variables you use in mathematics, which means they're a simple name to represent the data we want to refer to. Computer `variables` differ from mathematical variables in that they can store different values at different times.
|
||||
Las variables son similares a las variables x, e y que usan en matemáticas, lo que significa que son un nombre simple para representar los datos a los que queremos hacer referencia. Las variables de computadora difieren de las variables matemáticas en que pueden almacenar diferentes valores en diferentes momentos.
|
||||
|
||||
We tell JavaScript to create or <dfn>declare</dfn> a variable by putting the keyword `var` in front of it, like so:
|
||||
Le decimos a JavaScript que cree o <dfn>declare</dfn> una variable poniendo la palabra clave `var` delante de ella, así:
|
||||
|
||||
```js
|
||||
var ourName;
|
||||
```
|
||||
|
||||
creates a `variable` called `ourName`. In JavaScript we end statements with semicolons. `Variable` names can be made up of numbers, letters, and `$` or `_`, but may not contain spaces or start with a number.
|
||||
crea una variable llamada `ourName`. En JavaScript terminamos las sentencias con punto y coma. Los nombres de las variables pueden estar formados por números, letras y `$` o `_`, pero no pueden contener espacios ni empezar con un número.
|
||||
|
||||
# --instructions--
|
||||
|
||||
Use the `var` keyword to create a variable called `myName`.
|
||||
Utiliza la palabra clave `var` para crear una variable llamada `myName`.
|
||||
|
||||
**Hint**
|
||||
Look at the `ourName` example above if you get stuck.
|
||||
**Sugerencia**
|
||||
Mira el ejemplo `ourName` de arriba si te quedas atascado.
|
||||
|
||||
# --hints--
|
||||
|
||||
You should declare `myName` with the `var` keyword, ending with a semicolon
|
||||
Debes declarar `myName` con la palabra clave `var`, terminando con un punto y coma
|
||||
|
||||
```js
|
||||
assert(/var\s+myName\s*;/.test(code));
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
id: 56533eb9ac21ba0edf2244ad
|
||||
title: Decrement a Number with JavaScript
|
||||
title: Decrementa un número con JavaScript
|
||||
challengeType: 1
|
||||
videoUrl: 'https://scrimba.com/c/cM2KeS2'
|
||||
forumTopicId: 17558
|
||||
@ -9,30 +9,30 @@ dashedName: decrement-a-number-with-javascript
|
||||
|
||||
# --description--
|
||||
|
||||
You can easily <dfn>decrement</dfn> or decrease a variable by one with the `--` operator.
|
||||
Puedes fácilmente <dfn>decrementar</dfn> o disminuir una variable por uno utilizando el operador `--`.
|
||||
|
||||
`i--;`
|
||||
|
||||
is the equivalent of
|
||||
es equivalente a
|
||||
|
||||
`i = i - 1;`
|
||||
|
||||
**Note**
|
||||
The entire line becomes `i--;`, eliminating the need for the equal sign.
|
||||
**Nota**
|
||||
Toda la línea se convierte en `i--;`, eliminando la necesidad del signo de igualdad.
|
||||
|
||||
# --instructions--
|
||||
|
||||
Change the code to use the `--` operator on `myVar`.
|
||||
Cambia el código para usar el operador `--` en `myVar`.
|
||||
|
||||
# --hints--
|
||||
|
||||
`myVar` should equal `10`.
|
||||
`myVar` debe ser igual a `10`.
|
||||
|
||||
```js
|
||||
assert(myVar === 10);
|
||||
```
|
||||
|
||||
`myVar = myVar - 1;` should be changed.
|
||||
`myVar = myVar - 1;` debe cambiarse.
|
||||
|
||||
```js
|
||||
assert(
|
||||
@ -40,13 +40,13 @@ assert(
|
||||
);
|
||||
```
|
||||
|
||||
You should use the `--` operator on `myVar`.
|
||||
Debes usar el operador `--` en `myVar`.
|
||||
|
||||
```js
|
||||
assert(/[-]{2}\s*myVar|myVar\s*[-]{2}/.test(code));
|
||||
```
|
||||
|
||||
You should not change code above the specified comment.
|
||||
No debes cambiar el código por encima del comentario especificado.
|
||||
|
||||
```js
|
||||
assert(/var myVar = 11;/.test(code));
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
id: cf1111c1c11feddfaeb6bdef
|
||||
title: Divide One Number by Another with JavaScript
|
||||
title: Divide un número entre otro con JavaScript
|
||||
challengeType: 1
|
||||
videoUrl: 'https://scrimba.com/c/cqkbdAr'
|
||||
forumTopicId: 17566
|
||||
@ -9,11 +9,11 @@ dashedName: divide-one-number-by-another-with-javascript
|
||||
|
||||
# --description--
|
||||
|
||||
We can also divide one number by another.
|
||||
También podemos dividir un número entre otro.
|
||||
|
||||
JavaScript uses the `/` symbol for division.
|
||||
JavaScript utiliza el símbolo `/` para la división.
|
||||
|
||||
**Example**
|
||||
**Ejemplo**
|
||||
|
||||
```js
|
||||
myVar = 16 / 2; // assigned 8
|
||||
@ -21,17 +21,17 @@ myVar = 16 / 2; // assigned 8
|
||||
|
||||
# --instructions--
|
||||
|
||||
Change the `0` so that the `quotient` is equal to `2`.
|
||||
Cambia el `0` para que el `quotient` (cociente) sea igual a `2`.
|
||||
|
||||
# --hints--
|
||||
|
||||
The variable `quotient` should be equal to 2.
|
||||
La variable `quotient` debe ser igual a 2.
|
||||
|
||||
```js
|
||||
assert(quotient === 2);
|
||||
```
|
||||
|
||||
You should use the `/` operator.
|
||||
Debes usar el operador `/`.
|
||||
|
||||
```js
|
||||
assert(/\d+\s*\/\s*\d+/.test(code));
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
id: cf1231c1c11feddfaeb5bdef
|
||||
title: Multiply Two Numbers with JavaScript
|
||||
title: Multiplica dos números con JavaScript
|
||||
challengeType: 1
|
||||
videoUrl: 'https://scrimba.com/c/cP3y3Aq'
|
||||
forumTopicId: 18243
|
||||
@ -9,11 +9,11 @@ dashedName: multiply-two-numbers-with-javascript
|
||||
|
||||
# --description--
|
||||
|
||||
We can also multiply one number by another.
|
||||
También podemos multiplicar un número por otro.
|
||||
|
||||
JavaScript uses the `*` symbol for multiplication of two numbers.
|
||||
JavaScript utiliza el símbolo `*` para multiplicar dos números.
|
||||
|
||||
**Example**
|
||||
**Ejemplo**
|
||||
|
||||
```js
|
||||
myVar = 13 * 13; // assigned 169
|
||||
@ -21,17 +21,17 @@ myVar = 13 * 13; // assigned 169
|
||||
|
||||
# --instructions--
|
||||
|
||||
Change the `0` so that product will equal `80`.
|
||||
Cambia el `0` para que el producto sea igual a `80`.
|
||||
|
||||
# --hints--
|
||||
|
||||
The variable `product` should be equal to 80.
|
||||
La variable `product` debe ser igual a 80.
|
||||
|
||||
```js
|
||||
assert(product === 80);
|
||||
```
|
||||
|
||||
You should use the `*` operator.
|
||||
Debes usar el operador `*`.
|
||||
|
||||
```js
|
||||
assert(/\*/.test(code));
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
id: 56533eb9ac21ba0edf2244b4
|
||||
title: Quoting Strings with Single Quotes
|
||||
title: Cita cadenas con las comillas simples
|
||||
challengeType: 1
|
||||
videoUrl: 'https://scrimba.com/c/cbQmnhM'
|
||||
forumTopicId: 18260
|
||||
@ -9,39 +9,39 @@ dashedName: quoting-strings-with-single-quotes
|
||||
|
||||
# --description--
|
||||
|
||||
<dfn>String</dfn> values in JavaScript may be written with single or double quotes, as long as you start and end with the same type of quote. Unlike some other programming languages, single and double quotes work the same in JavaScript.
|
||||
Los valores de <dfn>cadena</dfn> en JavaScript pueden escribirse con comillas simples o dobles, siempre y cuando comiencen y terminen con el mismo tipo de comillas. A diferencia de otros lenguajes de programación, las comillas simples y dobles funcionan igual en JavaScript.
|
||||
|
||||
```js
|
||||
doubleQuoteStr = "This is a string";
|
||||
singleQuoteStr = 'This is also a string';
|
||||
```
|
||||
|
||||
The reason why you might want to use one type of quote over the other is if you want to use both in a string. This might happen if you want to save a conversation in a string and have the conversation in quotes. Another use for it would be saving an `<a>` tag with various attributes in quotes, all within a string.
|
||||
La razón por la que puedes querer usar un tipo de comilla sobre otro es si quieres usar ambos en una cadena. Esto puede suceder si quieres guardar una conversación en una cadena y tener la conversación entre comillas. Otro uso sería guardar una etiqueta `<a>` con varios atributos entre comillas, todo dentro de una cadena.
|
||||
|
||||
```js
|
||||
conversation = 'Finn exclaims to Jake, "Algebraic!"';
|
||||
```
|
||||
|
||||
However, this becomes a problem if you need to use the outermost quotes within it. Remember, a string has the same kind of quote at the beginning and end. But if you have that same quote somewhere in the middle, the string will stop early and throw an error.
|
||||
Sin embargo, esto se convierte en un problema cuando es necesario utilizar las comillas externas dentro de ella. Recuerda, una cadena tiene el mismo tipo de comillas al principio y al final. Pero si tienes esa misma comilla en algún lugar del medio, la cadena se detendrá temprano y arrojará un error.
|
||||
|
||||
```js
|
||||
goodStr = 'Jake asks Finn, "Hey, let\'s go on an adventure?"';
|
||||
badStr = 'Finn responds, "Let's go!"'; // Throws an error
|
||||
```
|
||||
|
||||
In the <dfn>goodStr</dfn> above, you can use both quotes safely by using the backslash <code>\\</code> as an escape character.
|
||||
En la cadena <dfn>goodStr</dfn> anterior, puedes usar ambas comillas de forma segura usando la barra invertida <code>\\</code> como un carácter de escape.
|
||||
|
||||
**Note:** The backslash <code>\\</code> should not be confused with the forward slash `/`. They do not do the same thing.
|
||||
**Nota:** La barra invertida <code>\\</code> no debe confundirse con la barra diagonal `/`. No hacen lo mismo.
|
||||
|
||||
# --instructions--
|
||||
|
||||
Change the provided string to a string with single quotes at the beginning and end and no escape characters.
|
||||
Cambia la cadena proporcionada a una cadena con comillas simples al principio y al final y sin caracteres de escape.
|
||||
|
||||
Right now, the `<a>` tag in the string uses double quotes everywhere. You will need to change the outer quotes to single quotes so you can remove the escape characters.
|
||||
Ahora mismo, la etiqueta `<a>` en la cadena usa comillas dobles en todas partes. Necesitarás cambiar las comillas externas a comillas simples para poder eliminar los caracteres de escape.
|
||||
|
||||
# --hints--
|
||||
|
||||
You should remove all the `backslashes` (<code>\\</code>).
|
||||
Deberías eliminar todas las barras invertidas `backslashes` (<code>\\</code>).
|
||||
|
||||
```js
|
||||
assert(
|
||||
@ -52,7 +52,7 @@ assert(
|
||||
);
|
||||
```
|
||||
|
||||
You should have two single quotes `'` and four double quotes `"`.
|
||||
Debes tener dos comillas simples `'` y cuatro comillas dobles `"`.
|
||||
|
||||
```js
|
||||
assert(code.match(/"/g).length === 4 && code.match(/'/g).length === 2);
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
id: bd7993c9c69feddfaeb8bdef
|
||||
title: Store Multiple Values in one Variable using JavaScript Arrays
|
||||
title: Almacena múltiples valores en una variable utilizando los arreglos de JavaScript
|
||||
challengeType: 1
|
||||
videoUrl: 'https://scrimba.com/c/crZQWAm'
|
||||
forumTopicId: 18309
|
||||
@ -9,34 +9,34 @@ dashedName: store-multiple-values-in-one-variable-using-javascript-arrays
|
||||
|
||||
# --description--
|
||||
|
||||
With JavaScript `array` variables, we can store several pieces of data in one place.
|
||||
Con las variables de arreglos (`array`) de JavaScript, podemos almacenar varios datos en un solo lugar.
|
||||
|
||||
You start an array declaration with an opening square bracket, end it with a closing square bracket, and put a comma between each entry, like this:
|
||||
Inicias una declaración de arreglo con un corchete de apertura, lo terminas con un corchete de cierre, y pones una coma entre cada entrada, de esta forma:
|
||||
|
||||
`var sandwich = ["peanut butter", "jelly", "bread"]`.
|
||||
|
||||
# --instructions--
|
||||
|
||||
Modify the new array `myArray` so that it contains both a `string` and a `number` (in that order).
|
||||
Modifica el nuevo arreglo `myArray` para que contenga tanto una `string` como un `number` (en ese orden).
|
||||
|
||||
**Hint**
|
||||
Refer to the example code in the text editor if you get stuck.
|
||||
**Sugerencia**
|
||||
Consulta el código de ejemplo en el editor de texto si te quedas atascado.
|
||||
|
||||
# --hints--
|
||||
|
||||
`myArray` should be an `array`.
|
||||
`myArray` debe ser un arreglo (`array`).
|
||||
|
||||
```js
|
||||
assert(typeof myArray == 'object');
|
||||
```
|
||||
|
||||
The first item in `myArray` should be a `string`.
|
||||
El primer elemento en `myArray` debe ser una cadena (`string`).
|
||||
|
||||
```js
|
||||
assert(typeof myArray[0] !== 'undefined' && typeof myArray[0] == 'string');
|
||||
```
|
||||
|
||||
The second item in `myArray` should be a `number`.
|
||||
El segundo elemento en `myArray` debe ser un número (`number`).
|
||||
|
||||
```js
|
||||
assert(typeof myArray[1] !== 'undefined' && typeof myArray[1] == 'number');
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
id: 56533eb9ac21ba0edf2244a8
|
||||
title: Storing Values with the Assignment Operator
|
||||
title: Almacenar valores con el operador de asignación
|
||||
challengeType: 1
|
||||
videoUrl: 'https://scrimba.com/c/cEanysE'
|
||||
forumTopicId: 18310
|
||||
@ -9,34 +9,34 @@ dashedName: storing-values-with-the-assignment-operator
|
||||
|
||||
# --description--
|
||||
|
||||
In JavaScript, you can store a value in a variable with the <dfn>assignment</dfn> operator (`=`).
|
||||
En JavaScript, puedes almacenar un valor en una variable con el operador de <dfn>asignación</dfn> (`=`).
|
||||
|
||||
`myVariable = 5;`
|
||||
|
||||
This assigns the `Number` value `5` to `myVariable`.
|
||||
Esto asigna el valor numérico (`Number`) `5` a `myVariable`.
|
||||
|
||||
If there are any calculations to the right of the `=` operator, those are performed before the value is assigned to the variable on the left of the operator.
|
||||
Si hay algunos cálculos a la derecha del operador `=`, se realizan antes de que el valor se asigne a la variable a la izquierda del operador.
|
||||
|
||||
```js
|
||||
var myVar;
|
||||
myVar = 5;
|
||||
```
|
||||
|
||||
First, this code creates a variable named `myVar`. Then, the code assigns `5` to `myVar`. Now, if `myVar` appears again in the code, the program will treat it as if it is `5`.
|
||||
Primero, este código crea una variable llamada `myVar`. Luego, el código asigna `5` a `myVar`. Ahora, si `myVar` aparece de nuevo en el código, el programa lo tratará como si fuera `5`.
|
||||
|
||||
# --instructions--
|
||||
|
||||
Assign the value `7` to variable `a`.
|
||||
Asigna el valor `7` a la variable `a`.
|
||||
|
||||
# --hints--
|
||||
|
||||
You should not change code above the specified comment.
|
||||
No debes cambiar el código por encima del comentario especificado.
|
||||
|
||||
```js
|
||||
assert(/var a;/.test(code));
|
||||
```
|
||||
|
||||
`a` should have a value of 7.
|
||||
`a` debe tener un valor de 7.
|
||||
|
||||
```js
|
||||
assert(typeof a === 'number' && a === 7);
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
id: 56533eb9ac21ba0edf2244ab
|
||||
title: Understanding Case Sensitivity in Variables
|
||||
title: Comprender la sensibilidad de mayúsculas en las variables
|
||||
challengeType: 1
|
||||
videoUrl: 'https://scrimba.com/c/cd6GDcD'
|
||||
forumTopicId: 18334
|
||||
@ -9,15 +9,15 @@ dashedName: understanding-case-sensitivity-in-variables
|
||||
|
||||
# --description--
|
||||
|
||||
In JavaScript all variables and function names are case sensitive. This means that capitalization matters.
|
||||
En JavaScript todas las variables y nombres de función son sensibles a mayúsculas y minúsculas. Esto significa que la capitalización importa.
|
||||
|
||||
`MYVAR` is not the same as `MyVar` nor `myvar`. It is possible to have multiple distinct variables with the same name but different casing. It is strongly recommended that for the sake of clarity, you *do not* use this language feature.
|
||||
`MYVAR` no es lo mismo que `MyVar` ni `myvar`. Es posible tener múltiples variables distintas con el mismo nombre pero diferente capitalización. Se recomienda encarecidamente que por el bien de la claridad, *no* utilices esta funcionalidad del lenguaje.
|
||||
|
||||
**Best Practice**
|
||||
**Buena Práctica**
|
||||
|
||||
Write variable names in JavaScript in <dfn>camelCase</dfn>. In <dfn>camelCase</dfn>, multi-word variable names have the first word in lowercase and the first letter of each subsequent word is capitalized.
|
||||
Escribe los nombres de las variables en JavaScript en <dfn>camelCase</dfn>. En <dfn>camelCase</dfn>, los nombres de variables de múltiples palabras tienen la primera palabra en minúsculas y la primera letra de cada palabra posterior en mayúsculas.
|
||||
|
||||
**Examples:**
|
||||
**Ejemplos:**
|
||||
|
||||
```js
|
||||
var someVariable;
|
||||
@ -27,18 +27,18 @@ var thisVariableNameIsSoLong;
|
||||
|
||||
# --instructions--
|
||||
|
||||
Modify the existing declarations and assignments so their names use <dfn>camelCase</dfn>.
|
||||
Do not create any new variables.
|
||||
Modifica las declaraciones y asignaciones existentes para que sus nombres usen <dfn>camelCase</dfn>.
|
||||
No crees nuevas variables.
|
||||
|
||||
# --hints--
|
||||
|
||||
`studlyCapVar` should be defined and have a value of `10`.
|
||||
`studlyCapVar` debe definirse y tener un valor de `10`.
|
||||
|
||||
```js
|
||||
assert(typeof studlyCapVar !== 'undefined' && studlyCapVar === 10);
|
||||
```
|
||||
|
||||
`properCamelCase` should be defined and have a value of `"A String"`.
|
||||
`properCamelCase` debe definirse y tener un valor de `"A String"`.
|
||||
|
||||
```js
|
||||
assert(
|
||||
@ -46,25 +46,25 @@ assert(
|
||||
);
|
||||
```
|
||||
|
||||
`titleCaseOver` should be defined and have a value of `9000`.
|
||||
`titleCaseOver` debe definirse y tener un valor de `9000`.
|
||||
|
||||
```js
|
||||
assert(typeof titleCaseOver !== 'undefined' && titleCaseOver === 9000);
|
||||
```
|
||||
|
||||
`studlyCapVar` should use camelCase in both declaration and assignment sections.
|
||||
`studlyCapVar` debe usar camelCase tanto en las sección de declaración como de asignación.
|
||||
|
||||
```js
|
||||
assert(code.match(/studlyCapVar/g).length === 2);
|
||||
```
|
||||
|
||||
`properCamelCase` should use camelCase in both declaration and assignment sections.
|
||||
`properCamelCase` debe usar camelCase tanto en las sección de declaración como de asignación.
|
||||
|
||||
```js
|
||||
assert(code.match(/properCamelCase/g).length === 2);
|
||||
```
|
||||
|
||||
`titleCaseOver` should use camelCase in both declaration and assignment sections.
|
||||
`titleCaseOver` debe usar camelCase tanto en las sección de declaración como de asignación.
|
||||
|
||||
```js
|
||||
assert(code.match(/titleCaseOver/g).length === 2);
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
id: bd7123c9c451eddfaeb5bdef
|
||||
title: Use Bracket Notation to Find the Last Character in a String
|
||||
title: Utilice la notación de corchete para encontrar el último carácter en una cadena
|
||||
challengeType: 1
|
||||
videoUrl: 'https://scrimba.com/c/cBZQGcv'
|
||||
forumTopicId: 18342
|
||||
@ -9,11 +9,11 @@ dashedName: use-bracket-notation-to-find-the-last-character-in-a-string
|
||||
|
||||
# --description--
|
||||
|
||||
In order to get the last letter of a string, you can subtract one from the string's length.
|
||||
Con el fin de obtener la última letra de una cadena, puede restar uno a la longitud del texto.
|
||||
|
||||
For example, if `var firstName = "Charles"`, you can get the value of the last letter of the string by using `firstName[firstName.length - 1]`.
|
||||
Por ejemplo, si `var firstName = "Charles"`, puedes obtener el valor de la última letra de la cadena usando `firstName[firstName.length - 1]`.
|
||||
|
||||
Example:
|
||||
Ejemplo:
|
||||
|
||||
```js
|
||||
var firstName = "Charles";
|
||||
@ -22,19 +22,19 @@ var lastLetter = firstName[firstName.length - 1]; // lastLetter is "s"
|
||||
|
||||
# --instructions--
|
||||
|
||||
Use <dfn>bracket notation</dfn> to find the last character in the `lastName` variable.
|
||||
Usa <dfn>notación de corchetes</dfn> para encontrar el último carácter en la variable `lastName`.
|
||||
|
||||
**Hint:** Try looking at the example above if you get stuck.
|
||||
**Sugerencia:** Intenta mirar el ejemplo de arriba si te quedas atascado.
|
||||
|
||||
# --hints--
|
||||
|
||||
`lastLetterOfLastName` should be "e".
|
||||
`lastLetterOfLastName` debe ser "e".
|
||||
|
||||
```js
|
||||
assert(lastLetterOfLastName === 'e');
|
||||
```
|
||||
|
||||
You should use `.length` to get the last letter.
|
||||
Debes usar `.length` para obtener la última letra.
|
||||
|
||||
```js
|
||||
assert(code.match(/\.length/g).length > 0);
|
||||
|
Reference in New Issue
Block a user