chore(i18n,learn): processed translations (#54537)

Co-authored-by: Naomi <nhcarrigan@gmail.com>
This commit is contained in:
freeCodeCamp's Camper Bot
2024-04-26 10:56:37 +05:30
committed by GitHub
parent adfb87e898
commit e6b05ee25d
2107 changed files with 8339 additions and 3516 deletions

View File

@@ -54,7 +54,7 @@ Los datos en la variable `myArray` deben ser accedidos utilizando notación de c
```js
assert(
(function () {
if (code.match(/\s*=\s*myArray\[0\]/g)) {
if (__helpers.removeJSComments(code).match(/\s*=\s*myArray\[0\]/g)) {
return true;
} else {
return false;

View File

@@ -45,7 +45,7 @@ assert(myData === 8);
Debes usar notación de corchetes para leer el valor correcto de `myArray`.
```js
assert(/myData=myArray\[2\]\[1\]/.test(__helpers.removeWhiteSpace(code)));
assert(/myData=myArray\[2\]\[1\]/.test(__helpers.removeWhiteSpace(__helpers.removeJSComments(code))));
```
# --seed--

View File

@@ -54,7 +54,7 @@ assert(secondTree === 'pine');
Tu código debe usar las notaciones de puntos y de corchetes para acceder a `myPlants`.
```js
assert(/=\s*myPlants\[1\].list\[1\]/.test(code));
assert(/=\s*myPlants\[1\].list\[1\]/.test(__helpers.removeJSComments(code)));
```
# --seed--

View File

@@ -64,7 +64,7 @@ assert(drinkValue === 'water');
Debes usar la notación de corchetes dos veces
```js
assert(code.match(/testObj\s*?\[('|")[^'"]+\1\]/g).length > 1);
assert(__helpers.removeJSComments(code).match(/testObj\s*?\[('|")[^'"]+\1\]/g).length > 1);
```
# --seed--

View File

@@ -60,7 +60,7 @@ assert(shirtValue === 'jersey');
Debes usar la notación de puntos dos veces
```js
assert(code.match(/testObj\.\w+/g).length > 1);
assert(__helpers.removeJSComments(code).match(/testObj\.\w+/g).length > 1);
```
# --seed--

View File

@@ -56,19 +56,19 @@ assert(player === 'Montana');
Debes usar la notación de corchetes para acceder a `testObj`
```js
assert(/testObj\s*?\[.*?\]/.test(code));
assert(/testObj\s*?\[.*?\]/.test(__helpers.removeJSComments(code)));
```
No debes asignar el valor de `Montana` a la variable `player` directamente.
```js
assert(!code.match(/player\s*=\s*"|\'\s*Montana\s*"|\'\s*;/gi));
assert(!__helpers.removeJSComments(code).match(/player\s*=\s*"|\'\s*Montana\s*"|\'\s*;/gi));
```
Debes usar la variable `playerNumber` en tu notación de corchetes
```js
assert(/testObj\s*?\[\s*playerNumber\s*\]/.test(code));
assert(/testObj\s*?\[\s*playerNumber\s*\]/.test(__helpers.removeJSComments(code)));
```
# --seed--

View File

@@ -53,7 +53,7 @@ assert(myDog.bark !== undefined);
No debes agregar `bark` a la inicialización de `myDog`.
```js
assert(!/bark[^\n]:/.test(code));
assert(!/bark[^\n]:/.test(__helpers.removeJSComments(code)));
```
# --seed--

View File

@@ -38,7 +38,7 @@ assert(sum === 20);
Debes usar el operador `+`.
```js
assert(/\+/.test(code));
assert(/\+/.test(__helpers.removeJSComments(code)));
```
# --seed--

View File

@@ -71,7 +71,7 @@ assert(switchOfStuff(4) === 'stuff');
No debes usar ninguna sentencia `if` o `else`
```js
assert(!/else/g.test(code) || !/if/g.test(code));
assert(!/else/g.test(__helpers.removeJSComments(code)) || !/if/g.test(__helpers.removeJSComments(code)));
```
Debes utilizar una declaración `default`
@@ -83,7 +83,7 @@ assert(switchOfStuff('string-to-trigger-default-case') === 'stuff');
Debes tener al menos 3 declaraciones de ruptura (`break`)
```js
assert(code.match(/break/g).length > 2);
assert(__helpers.removeJSComments(code).match(/break/g).length > 2);
```
# --seed--

View File

@@ -36,7 +36,7 @@ assert(typeof someAdjective !== 'undefined' && someAdjective.length > 2);
Debes añadir `someAdjective` a `myStr` usando el operador `+=`.
```js
assert(code.match(/myStr\s*\+=\s*someAdjective\s*/).length > 0);
assert(__helpers.removeJSComments(code).match(/myStr\s*\+=\s*someAdjective\s*/).length > 0);
```
# --seed--

View File

@@ -29,7 +29,7 @@ Asigna el contenido de `a` a la variable `b`.
No debes cambiar el código por encima del comentario especificado.
```js
assert(/var a;/.test(code) && /a = 7;/.test(code) && /var b;/.test(code));
assert(/var a;/.test(__helpers.removeJSComments(code)) && /a = 7;/.test(__helpers.removeJSComments(code)) && /var b;/.test(__helpers.removeJSComments(code)));
```
`b` debe tener un valor de `7`.
@@ -41,7 +41,7 @@ assert(typeof b === 'number' && b === 7);
`a` debe ser asignado a `b` utilizando `=`.
```js
assert(/b\s*=\s*a\s*/g.test(code));
assert(/b\s*=\s*a\s*/g.test(__helpers.removeJSComments(code)));
```
# --seed--

View File

@@ -34,7 +34,7 @@ assert(processed === 2);
Debes asignar `processArg` para `processed`
```js
assert(/processed\s*=\s*processArg\(\s*7\s*\)/.test(code));
assert(/processed\s*=\s*processArg\(\s*7\s*\)/.test(__helpers.removeJSComments(code)));
```
# --seed--

View File

@@ -39,19 +39,19 @@ Escribe sentencias `if` / `else if` encadenadas para cumplir con las siguientes
Debes tener al menos cuatro sentencias `else`
```js
assert(code.match(/else/g).length > 3);
assert(__helpers.removeJSComments(code).match(/else/g).length > 3);
```
Debes tener al menos cuatro sentencias `if`
```js
assert(code.match(/if/g).length > 3);
assert(__helpers.removeJSComments(code).match(/if/g).length > 3);
```
Debes tener al menos una sentencia `return`
```js
assert(code.match(/return/g).length >= 1);
assert(__helpers.removeJSComments(code).match(/return/g).length >= 1);
```
`testSize(0)` debe devolver la cadena `Tiny`

View File

@@ -2,7 +2,6 @@
id: bd7123c9c441eddfaeb4bdef
title: Comenta tu código de JavaScript
challengeType: 1
removeComments: false
videoUrl: 'https://scrimba.com/c/c7ynnTp'
forumTopicId: 16783
dashedName: comment-your-javascript-code

View File

@@ -58,7 +58,7 @@ assert(testEqual('12') === 'Equal');
Debes usar el operador `==`
```js
assert(code.match(/==/g) && !code.match(/===/g));
assert(__helpers.removeJSComments(code).match(/==/g) && !__helpers.removeJSComments(code).match(/===/g));
```
# --seed--

View File

@@ -73,7 +73,7 @@ assert(testGreaterThan(150) === 'Over 100');
Debes usar el operador `>` por lo menos dos veces
```js
assert(code.match(/val\s*>\s*('|")*\d+('|")*/g).length > 1);
assert(__helpers.removeJSComments(code).match(/val\s*>\s*('|")*\d+('|")*/g).length > 1);
```
# --seed--

View File

@@ -73,7 +73,7 @@ assert(testGreaterOrEqual(21) === '20 or Over');
Debes utilizar el operador `>=` al menos dos veces
```js
assert(code.match(/val\s*>=\s*('|")*\d+('|")*/g).length > 1);
assert(__helpers.removeJSComments(code).match(/val\s*>=\s*('|")*\d+('|")*/g).length > 1);
```
# --seed--

View File

@@ -60,7 +60,7 @@ assert(testNotEqual('bob') === 'Not Equal');
Debes utilizar el operador `!=`
```js
assert(code.match(/(?!!==)!=/));
assert(__helpers.removeJSComments(code).match(/(?!!==)!=/));
```
# --seed--

View File

@@ -66,7 +66,7 @@ assert(testLessThan(99) === '55 or Over');
Debes usar el operador `<` por lo menos dos veces
```js
assert(code.match(/val\s*<\s*('|")*\d+('|")*/g).length > 1);
assert(__helpers.removeJSComments(code).match(/val\s*<\s*('|")*\d+('|")*/g).length > 1);
```
# --seed--

View File

@@ -72,7 +72,7 @@ assert(testLessOrEqual(55) === 'More Than 24');
Debes utilizar el operador `<=` al menos dos veces
```js
assert(code.match(/val\s*<=\s*('|")*\d+('|")*/g).length > 1);
assert(__helpers.removeJSComments(code).match(/val\s*<=\s*('|")*\d+('|")*/g).length > 1);
```
# --seed--

View File

@@ -49,7 +49,7 @@ assert(testStrict('7') === 'Not Equal');
Debes usar el operador `===`
```js
assert(code.match(/(val\s*===\s*\d+)|(\d+\s*===\s*val)/g).length > 0);
assert(__helpers.removeJSComments(code).match(/(val\s*===\s*\d+)|(\d+\s*===\s*val)/g).length > 0);
```
# --seed--

View File

@@ -52,7 +52,7 @@ assert(testStrictNotEqual('bob') === 'Not Equal');
Debes usar el operador `!==`
```js
assert(code.match(/(val\s*!==\s*\d+)|(\d+\s*!==\s*val)/g).length > 0);
assert(__helpers.removeJSComments(code).match(/(val\s*!==\s*\d+)|(\d+\s*!==\s*val)/g).length > 0);
```
# --seed--

View File

@@ -40,13 +40,13 @@ Reemplaza las dos sentencias if por una sola, usando el operador `&&`, el cual d
Debes usar el operador `&&` una vez
```js
assert(code.match(/&&/g).length === 1);
assert(__helpers.removeJSComments(code).match(/&&/g).length === 1);
```
Debes tener una sola sentencia `if`
```js
assert(code.match(/if/g).length === 1);
assert(__helpers.removeJSComments(code).match(/if/g).length === 1);
```
`testLogicalAnd(0)` debe devolver la cadena `No`

View File

@@ -43,13 +43,13 @@ Combina las dos sentencias `if` en una sola sentencia que devuelva la cadena `Ou
Debes usar el operador `||` una vez
```js
assert(code.match(/\|\|/g).length === 1);
assert(__helpers.removeJSComments(code).match(/\|\|/g).length === 1);
```
Debes tener una sola sentencia `if`
```js
assert(code.match(/if/g).length === 1);
assert(__helpers.removeJSComments(code).match(/if/g).length === 1);
```
`testLogicalOr(0)` debe devolver la cadena `Outside`

View File

@@ -54,16 +54,16 @@ assert(c === 19);
Debes usar el operador `+=` para cada variable.
```js
assert(code.match(/\+=/g).length === 3);
assert(__helpers.removeJSComments(code).match(/\+=/g).length === 3);
```
No debes modificar el código por encima del comentario especificado.
```js
assert(
/let a = 3;/.test(code) &&
/let b = 17;/.test(code) &&
/let c = 12;/.test(code)
/let a = 3;/.test(__helpers.removeJSComments(code)) &&
/let b = 17;/.test(__helpers.removeJSComments(code)) &&
/let c = 12;/.test(__helpers.removeJSComments(code))
);
```

View File

@@ -48,16 +48,16 @@ assert(c === 3);
Debes usar el operador `/=` para cada variable.
```js
assert(code.match(/\/=/g).length === 3);
assert(__helpers.removeJSComments(code).match(/\/=/g).length === 3);
```
No debes modificar el código sobre el comentario especificado.
```js
assert(
/let a = 48;/.test(code) &&
/let b = 108;/.test(code) &&
/let c = 33;/.test(code)
/let a = 48;/.test(__helpers.removeJSComments(code)) &&
/let b = 108;/.test(__helpers.removeJSComments(code)) &&
/let c = 33;/.test(__helpers.removeJSComments(code))
);
```

View File

@@ -48,16 +48,16 @@ assert(c === 46);
Debes usar el operador `*=` para cada variable.
```js
assert(code.match(/\*=/g).length === 3);
assert(__helpers.removeJSComments(code).match(/\*=/g).length === 3);
```
No debes modificar el código sobre el comentario especificado.
```js
assert(
/let a = 5;/.test(code) &&
/let b = 12;/.test(code) &&
/let c = 4\.6;/.test(code)
/let a = 5;/.test(__helpers.removeJSComments(code)) &&
/let b = 12;/.test(__helpers.removeJSComments(code)) &&
/let c = 4\.6;/.test(__helpers.removeJSComments(code))
);
```

View File

@@ -48,14 +48,14 @@ assert(c === 2);
Debes usar el operador `-=` para cada variable.
```js
assert(code.match(/-=/g).length === 3);
assert(__helpers.removeJSComments(code).match(/-=/g).length === 3);
```
No debes modificar el código sobre el comentario especificado.
```js
assert(
/let a = 11;/.test(code) && /let b = 9;/.test(code) && /let c = 3;/.test(code)
/let a = 11;/.test(__helpers.removeJSComments(code)) && /let b = 9;/.test(__helpers.removeJSComments(code)) && /let c = 3;/.test(__helpers.removeJSComments(code))
);
```

View File

@@ -47,19 +47,19 @@ assert(myStr === 'This is the start. This is the end.');
Deberías usar el operador `+` para construir `myStr`.
```js
assert(code.match(/(["']).*\1\s*\+\s*(["']).*\2/g));
assert(__helpers.removeJSComments(code).match(/(["']).*\1\s*\+\s*(["']).*\2/g));
```
`myStr` Debe crearse una variable con la palabra reservada `const`.
```js
assert(/const\s+myStr/.test(code));
assert(/const\s+myStr/.test(__helpers.removeJSComments(code)));
```
Debes asignar el resultado a la variable `myStr`.
```js
assert(/myStr\s*=/.test(code));
assert(/myStr\s*=/.test(__helpers.removeJSComments(code)));
```
# --seed--

View File

@@ -43,7 +43,7 @@ assert(myStr === 'This is the first sentence. This is the second sentence.');
Deberías usar el operador `+=` para construir `myStr`.
```js
assert(code.match(/myStr\s*\+=\s*(["']).*\1/g));
assert(__helpers.removeJSComments(code).match(/myStr\s*\+=\s*(["']).*\1/g));
```
# --seed--

View File

@@ -35,7 +35,7 @@ assert(typeof myName !== 'undefined' && myName.length > 2);
Debes usar dos operadores `+` para construir `myStr` con `myName` dentro de él.
```js
assert(code.match(/["']\s*\+\s*myName\s*\+\s*["']/g).length > 0);
assert(__helpers.removeJSComments(code).match(/["']\s*\+\s*myName\s*\+\s*["']/g).length > 0);
```
# --seed--

View File

@@ -34,13 +34,13 @@ Inserta los números impares desde el 9 hasta el 1 en `myArray` utilizando un bu
Debes utilizar un bucle `for` para esto.
```js
assert(/for\s*\([^)]+?\)/.test(code));
assert(/for\s*\([^)]+?\)/.test(__helpers.removeJSComments(code)));
```
Debes utilizar el método de arreglo `push`.
```js
assert(code.match(/myArray.push/));
assert(__helpers.removeJSComments(code).match(/myArray.push/));
```
`myArray` debe ser igual a `[9, 7, 5, 3, 1]`.

View File

@@ -37,7 +37,7 @@ Mira el ejemplo `ourName` de arriba si te quedas atascado.
Debes declarar `myName` con la palabra clave `var`, terminando con un punto y coma
```js
assert(/var\s+myName\s*;/.test(code));
assert(/var\s+myName\s*;/.test(__helpers.removeJSComments(code)));
```
# --seed--

View File

@@ -38,25 +38,25 @@ assert(myVar === 10);
`myVar = myVar - 1;` debe cambiarse.
```js
assert(!code.match(/myVar\s*=\s*myVar\s*[-]\s*1.*?;?/));
assert(!__helpers.removeJSComments(code).match(/myVar\s*=\s*myVar\s*[-]\s*1.*?;?/));
```
No debes asignar `myVar` con `10`.
```js
assert(!code.match(/myVar\s*=\s*10.*?;?/));
assert(!__helpers.removeJSComments(code).match(/myVar\s*=\s*10.*?;?/));
```
Debes usar el operador `--` en `myVar`.
```js
assert(/[-]{2}\s*myVar|myVar\s*[-]{2}/.test(code));
assert(/[-]{2}\s*myVar|myVar\s*[-]{2}/.test(__helpers.removeJSComments(code)));
```
No debes cambiar el código por encima del comentario especificado.
```js
assert(/let myVar = 11;/.test(code));
assert(/let myVar = 11;/.test(__helpers.removeJSComments(code)));
```
# --seed--

View File

@@ -55,7 +55,7 @@ assert(typeof myDog === 'object' && myDog.tails === undefined);
No debes modificar la disposición de `myDog`.
```js
assert(code.match(/"tails": 1/g).length > 0);
assert(__helpers.removeJSComments(code).match(/"tails": 1/g).length > 0);
```
# --seed--

View File

@@ -26,13 +26,13 @@ assert(quotient === 2.2);
Debes usar el operador `/` para dividir 4.4 entre 2
```js
assert(/4\.40*\s*\/\s*2\.*0*/.test(code));
assert(/4\.40*\s*\/\s*2\.*0*/.test(__helpers.removeJSComments(code)));
```
La variable quotient debe ser asignada solo una vez
```js
assert(code.match(/quotient\s*=/g).length === 1);
assert(__helpers.removeJSComments(code).match(/quotient\s*=/g).length === 1);
```
# --seed--

View File

@@ -35,7 +35,7 @@ assert(quotient === 2);
Debes usar el operador `/`.
```js
assert(/\d+\s*\/\s*\d+/.test(code));
assert(/\d+\s*\/\s*\d+/.test(__helpers.removeJSComments(code)));
```
# --seed--

View File

@@ -36,7 +36,7 @@ I am a "double quoted" string inside "double quotes".
Debes usar dos comillas dobles (`"`) y cuatro comillas dobles escapadas (`\"`).
```js
assert(code.match(/\\"/g).length === 4 && code.match(/[^\\]"/g).length === 2);
assert(__helpers.removeJSComments(code).match(/\\"/g).length === 4 && __helpers.removeJSComments(code).match(/[^\\]"/g).length === 2);
```
La variable `myStr` debe contener la cadena: `I am a "double quoted" string inside "double quotes".`

View File

@@ -29,8 +29,8 @@ No debes cambiar las declaraciones de variables en la sección `// Setup`.
```js
assert(
code.match(/let lastNameLength = 0;/) &&
code.match(/const lastName = "Lovelace";/)
__helpers.removeJSComments(code).match(/let lastNameLength = 0;/) &&
__helpers.removeJSComments(code).match(/const lastName = "Lovelace";/)
);
```
@@ -43,7 +43,7 @@ assert(typeof lastNameLength !== 'undefined' && lastNameLength === 8);
Debes obtener la longitud de `lastName` usando `.length` de esta forma: `lastName.length`.
```js
assert(code.match(/=\s*lastName\.length/g) && !code.match(/lastName\s*=\s*8/));
assert(__helpers.removeJSComments(code).match(/=\s*lastName\.length/g) && !__helpers.removeJSComments(code).match(/lastName\s*=\s*8/));
```
# --seed--

View File

@@ -39,7 +39,7 @@ Establece `remainder` igual al resto de `11` dividido entre `3` usando el operad
La variable `remainder` debe inicializarse
```js
assert(/(const|let|var)\s+?remainder/.test(code));
assert(/(const|let|var)\s+?remainder/.test(__helpers.removeJSComments(code)));
```
El valor de `remainder` debe ser `2`
@@ -51,7 +51,7 @@ assert(remainder === 2);
Debes usar el operador `%`
```js
assert(/\s+?remainder\s*?=\s*?.*%.*;?/.test(code));
assert(/\s+?remainder\s*?=\s*?.*%.*;?/.test(__helpers.removeJSComments(code)));
```
# --seed--

View File

@@ -36,7 +36,7 @@ assert((randomFraction() + '').match(/\./g));
Debes usar `Math.random` para generar el número decimal aleatorio.
```js
assert(code.match(/Math\.random/g).length >= 0);
assert(__helpers.removeJSComments(code).match(/Math\.random/g).length >= 0);
```
# --seed--

View File

@@ -46,22 +46,22 @@ assert(
Debes usar `Math.random` para generar un número aleatorio.
```js
assert(code.match(/Math.random/g).length >= 1);
assert(__helpers.removeJSComments(code).match(/Math.random/g).length >= 1);
```
Debes haber multiplicado el resultado de `Math.random` por 10 para convertirlo en un número en el rango de cero a nueve.
```js
assert(
code.match(/\s*?Math.random\s*?\(\s*?\)\s*?\*\s*?10[\D]\s*?/g) ||
code.match(/\s*?10\s*?\*\s*?Math.random\s*?\(\s*?\)\s*?/g)
__helpers.removeJSComments(code).match(/\s*?Math.random\s*?\(\s*?\)\s*?\*\s*?10[\D]\s*?/g) ||
__helpers.removeJSComments(code).match(/\s*?10\s*?\*\s*?Math.random\s*?\(\s*?\)\s*?/g)
);
```
Debes usar `Math.floor` para eliminar la parte decimal del número.
```js
assert(code.match(/Math.floor/g).length >= 1);
assert(__helpers.removeJSComments(code).match(/Math.floor/g).length >= 1);
```
# --seed--

View File

@@ -49,10 +49,10 @@ assert(randomRange(0, 1) % 1 === 0);
assert(
(function () {
if (
code.match(/myMax/g).length > 1 &&
code.match(/myMin/g).length > 2 &&
code.match(/Math.floor/g) &&
code.match(/Math.random/g)
__helpers.removeJSComments(code).match(/myMax/g).length > 1 &&
__helpers.removeJSComments(code).match(/myMin/g).length > 2 &&
__helpers.removeJSComments(code).match(/Math.floor/g) &&
__helpers.removeJSComments(code).match(/Math.random/g)
) {
return true;
} else {

View File

@@ -36,7 +36,7 @@ assert(myGlobal === 10);
`myGlobal` debe declararse usando las palabras clave `let` o `const`
```js
assert(/(let|const)\s+myGlobal/.test(code));
assert(/(let|const)\s+myGlobal/.test(__helpers.removeJSComments(code)));
```
`oopsGlobal` debe ser una variable global y tener un valor de `5`

View File

@@ -45,7 +45,7 @@ assert(myOutfit() === 'sweater');
No debes cambiar la declaración de devolución.
```js
assert(/return outerWear/.test(code));
assert(/return outerWear/.test(__helpers.removeJSComments(code)));
```
# --seed--

View File

@@ -39,20 +39,20 @@ No debes utilizar el operador de asignación.
```js
assert(
/let\s*myVar\s*=\s*87;\s*\/*.*\s*([+]{2}\s*myVar|myVar\s*[+]{2})/.test(code)
/let\s*myVar\s*=\s*87;\s*\/*.*\s*([+]{2}\s*myVar|myVar\s*[+]{2})/.test(__helpers.removeJSComments(code))
);
```
Debes usar el operador `++`.
```js
assert(/[+]{2}\s*myVar|myVar\s*[+]{2}/.test(code));
assert(/[+]{2}\s*myVar|myVar\s*[+]{2}/.test(__helpers.removeJSComments(code)));
```
No debes cambiar el código por encima del comentario especificado.
```js
assert(/let myVar = 87;/.test(code));
assert(/let myVar = 87;/.test(__helpers.removeJSComments(code)));
```
# --seed--

View File

@@ -26,7 +26,7 @@ Define una variable `a` con `var` e inicialízala con un valor de `9`.
Debes inicializar `a` con un valor de `9`.
```js
assert(/var\s+a\s*=\s*9(\s*;?\s*)$/.test(code));
assert(/var\s+a\s*=\s*9(\s*;?\s*)$/.test(__helpers.removeJSComments(code)));
```
# --seed--

View File

@@ -30,20 +30,20 @@ Transforma la lógica para utilizar la sentencia `else if`.
Debes tener al menos dos sentencias `else`
```js
assert(code.match(/else/g).length > 1);
assert(__helpers.removeJSComments(code).match(/else/g).length > 1);
```
Debes tener al menos dos sentencias `if`
```js
assert(code.match(/if/g).length > 1);
assert(__helpers.removeJSComments(code).match(/if/g).length > 1);
```
Debes utilizar llaves de apertura y cierre para cada bloque de código `if else`.
```js
assert(
code.match(
__helpers.removeJSComments(code).match(
/if\s*\((.+)\)\s*\{[\s\S]+\}\s*else\s+if\s*\((.+)\)\s*\{[\s\S]+\}\s*else\s*\{[\s\S]+\s*\}/
)
);

View File

@@ -28,13 +28,13 @@ Combina la sentencia `if` en una sola sentencia `if/else`.
Sólo debes tener una sentencia `if` en el editor
```js
assert(code.match(/if/g).length === 1);
assert(__helpers.removeJSComments(code).match(/if/g).length === 1);
```
Debes usar una sentencia `else`
```js
assert(/else/g.test(code));
assert(/else/g.test(__helpers.removeJSComments(code)));
```
`testElse(4)` debe devolver la cadena `5 or Smaller`
@@ -64,7 +64,7 @@ assert(testElse(10) === 'Bigger than 5');
No debes cambiar el código por encima o por debajo de los comentarios especificados.
```js
assert(/let result = "";/.test(code) && /return result;/.test(code));
assert(/let result = "";/.test(__helpers.removeJSComments(code)) && /return result;/.test(__helpers.removeJSComments(code)));
```
# --seed--

View File

@@ -32,7 +32,7 @@ Inserta los números impares desde 1 hasta 9 en `myArray` utilizando un bucle `f
Debes utilizar un bucle `for` para esto.
```js
assert(/for\s*\([^)]+?\)/.test(code));
assert(/for\s*\([^)]+?\)/.test(__helpers.removeJSComments(code)));
```
`myArray` debe ser igual a `[1, 3, 5, 7, 9]`.

View File

@@ -30,7 +30,7 @@ Declara e inicializa una variable `total` a `0`. Usa un bucle `for` para sumar e
`total` debe declararse e inicializarse a 0.
```js
assert(code.match(/(var|let|const)\s*?total\s*=\s*0.*?;?/));
assert(__helpers.removeJSComments(code).match(/(var|let|const)\s*?total\s*=\s*0.*?;?/));
```
`total` debe ser igual a 20.
@@ -42,13 +42,13 @@ assert(total === 20);
Debes usar un bucle `for` para iterar a través de `myArr`.
```js
assert(/for\s*\(/g.test(code) && /myArr\s*\[/g.test(code));
assert(/for\s*\(/g.test(__helpers.removeJSComments(code)) && /myArr\s*\[/g.test(__helpers.removeJSComments(code)));
```
No debes intentar asignar directamente el valor 20 al `total`.
```js
assert(!__helpers.removeWhiteSpace(code).match(/total[=+-]0*[1-9]+/gm));
assert(!__helpers.removeWhiteSpace(__helpers.removeJSComments(code)).match(/total[=+-]0*[1-9]+/gm));
```
# --seed--

View File

@@ -56,7 +56,7 @@ Cambia el bucle `while` en el código por un bucle `do...while`. El bucle solo e
Debes utilizar el bucle `do...while` para este ejercicio.
```js
assert(code.match(/do/g));
assert(__helpers.removeJSComments(code).match(/do/g));
```
`myArray` debe ser igual a `[10]`.

View File

@@ -44,7 +44,7 @@ Usa un bucle `for` para empujar los valores desde el 1 al 5 en `myArray`.
Debes usar un bucle `for` para esto.
```js
assert(/for\s*\([^)]+?\)/.test(code));
assert(/for\s*\([^)]+?\)/.test(__helpers.removeJSComments(code)));
```
`myArray` debe ser igual a `[1, 2, 3, 4, 5]`.

View File

@@ -36,7 +36,7 @@ Agrega los números de 5 a 0 (inclusivo) en orden descendente a `myArray` usando
Debes utilizar un bucle `while` para esto.
```js
assert(code.match(/while/g));
assert(__helpers.removeJSComments(code).match(/while/g));
```
`myArray` debe ser igual a `[5, 4, 3, 2, 1, 0]`.

View File

@@ -48,7 +48,7 @@ Debes agregar una variable local `myVar`.
```js
assert(
/functionmyLocalScope\(\)\{.*(var|let|const)myVar[\s\S]*}/.test(
__helpers.removeWhiteSpace(code)
__helpers.removeWhiteSpace(__helpers.removeJSComments(code))
)
);
```

View File

@@ -47,7 +47,7 @@ assert(
Debes usar `pop()` en `myArray`.
```js
assert(/removedFromMyArray\s*=\s*myArray\s*.\s*pop\s*(\s*)/.test(code));
assert(/removedFromMyArray\s*=\s*myArray\s*.\s*pop\s*(\s*)/.test(__helpers.removeJSComments(code)));
```
`removedFromMyArray` sólo debe contener `["cat", 2]`.

View File

@@ -52,7 +52,7 @@ Debes usar el índice correcto para modificar el valor en `myArray`.
```js
assert(
(function () {
if (code.match(/myArray\[0\]\s*=\s*/g)) {
if (__helpers.removeJSComments(code).match(/myArray\[0\]\s*=\s*/g)) {
return true;
} else {
return false;

View File

@@ -94,13 +94,13 @@ assert(sequentialSizes(9) === 'High');
No debes utilizar las sentencias `if` o `else`
```js
assert(!/else/g.test(code) || !/if/g.test(code));
assert(!/else/g.test(__helpers.removeJSComments(code)) || !/if/g.test(__helpers.removeJSComments(code)));
```
Debes tener nueve sentencias `case`
```js
assert(code.match(/case/g).length === 9);
assert(__helpers.removeJSComments(code).match(/case/g).length === 9);
```
# --seed--

View File

@@ -28,7 +28,7 @@ assert(product === 5.0);
Debes utilizar el operador `*`
```js
assert(/\*/.test(code));
assert(/\*/.test(__helpers.removeJSComments(code)));
```
# --seed--

View File

@@ -36,7 +36,7 @@ assert(product === 80);
Debes usar el operador `*`.
```js
assert(/\*/.test(code));
assert(/\*/.test(__helpers.removeJSComments(code)));
```
# --seed--

View File

@@ -60,7 +60,7 @@ Debes llamar `functionWithArgs` con dos números después de definirla.
```js
assert(
/functionWithArgs\([-+]?\d*\.?\d*,[-+]?\d*\.?\d*\)/.test(
code.replace(/\s/g, '')
__helpers.removeJSComments(code).replace(/\s/g, '')
)
);
```

View File

@@ -47,7 +47,7 @@ assert(compareEquality('20', 20) === 'Not Equal');
Debes usar el operador `===`
```js
assert(code.match(/===/g));
assert(__helpers.removeJSComments(code).match(/===/g));
```
# --seed--

View File

@@ -47,7 +47,7 @@ Debes eliminar todas las barras invertidas (`\`).
```js
assert(
!/\\/g.test(code) &&
!/\\/g.test(__helpers.removeJSComments(code)) &&
myStr.match(
'\\s*<a href\\s*=\\s*"http://www.example.com"\\s*target\\s*=\\s*"_blank">\\s*Link\\s*</a>\\s*'
)
@@ -57,7 +57,7 @@ assert(
Debes tener dos comillas simples `'` y cuatro comillas dobles `"`.
```js
assert(code.match(/"/g).length === 4 && code.match(/'/g).length === 2);
assert(__helpers.removeJSComments(code).match(/"/g).length === 4 && __helpers.removeJSComments(code).match(/'/g).length === 2);
```
# --seed--

View File

@@ -66,7 +66,7 @@ Tu código no debe depender de ningún tipo de bluces (`for` o `while`) o funcio
```js
assert(
!code.match(/for|while|forEach|map|filter|reduce/g)
!__helpers.removeJSComments(code).match(/for|while|forEach|map|filter|reduce/g)
);
```

View File

@@ -45,19 +45,19 @@ Cambia la cadena de sentencias `if`/`else if` por una sentencia `switch`.
No debes utilizar sentencias `else` en ningún lugar en el editor
```js
assert(!/else/g.test(code));
assert(!/else/g.test(__helpers.removeJSComments(code)));
```
No debes utilizar sentencias `if` en ningún lugar en el editor
```js
assert(!/if/g.test(code));
assert(!/if/g.test(__helpers.removeJSComments(code)));
```
Debes tener al menos cuatro sentencias `break`
```js
assert(code.match(/break/g).length >= 4);
assert(__helpers.removeJSComments(code).match(/break/g).length >= 4);
```
`chainToSwitch("bob")` debe devolver una cadena `Marley`

View File

@@ -52,7 +52,7 @@ assert(isLess(15, 10) === false);
No debes utilizar las sentencias `if` o `else`
```js
assert(!/if|else/g.test(code));
assert(!/if|else/g.test(__helpers.removeJSComments(code)));
```
# --seed--

View File

@@ -63,13 +63,13 @@ assert(caseInSwitch(4) === 'delta');
No debes usar ninguna sentencia `if` o `else`
```js
assert(!/else/g.test(code) || !/if/g.test(code));
assert(!/else/g.test(__helpers.removeJSComments(code)) || !/if/g.test(__helpers.removeJSComments(code)));
```
Debes tener al menos 3 declaraciones `break`
```js
assert(code.match(/break/g).length > 2);
assert(__helpers.removeJSComments(code).match(/break/g).length > 2);
```
# --seed--

View File

@@ -35,7 +35,7 @@ Asigna el valor `7` a la variable `a`.
No debes cambiar el código por encima del comentario especificado.
```js
assert(/var a;/.test(code));
assert(/var a;/.test(__helpers.removeJSComments(code)));
```
`a` debe tener un valor de 7.

View File

@@ -35,7 +35,7 @@ assert(difference === 12);
Solo debes restar un número de `45`.
```js
assert(/difference=45-33;?/.test(__helpers.removeWhiteSpace(code)));
assert(/difference=45-33;?/.test(__helpers.removeWhiteSpace(__helpers.removeJSComments(code))));
```
# --seed--

View File

@@ -40,7 +40,7 @@ assert(myStr === 'Hello World');
No debes cambiar el código por encima del comentario especificado.
```js
assert(/myStr = "Jello World"/.test(code));
assert(/myStr = "Jello World"/.test(__helpers.removeJSComments(code)));
```
# --seed--

View File

@@ -56,19 +56,19 @@ assert(typeof titleCaseOver !== 'undefined' && titleCaseOver === 9000);
`studlyCapVar` debe usar camelCase tanto en las secciones de declaración como de asignación.
```js
assert(code.match(/studlyCapVar/g).length === 2);
assert(__helpers.removeJSComments(code).match(/studlyCapVar/g).length === 2);
```
`properCamelCase` debe usar camelCase tanto en las secciones de declaración como de asignación.
```js
assert(code.match(/properCamelCase/g).length === 2);
assert(__helpers.removeJSComments(code).match(/properCamelCase/g).length === 2);
```
`titleCaseOver` debe usar camelCase tanto en las secciones de declaración como de asignación.
```js
assert(code.match(/titleCaseOver/g).length === 2);
assert(__helpers.removeJSComments(code).match(/titleCaseOver/g).length === 2);
```
# --seed--

View File

@@ -39,9 +39,9 @@ No debes cambiar el código debajo del comentario especificado.
```js
assert(
/a = a \+ 1;/.test(code) &&
/b = b \+ 5;/.test(code) &&
/c = c \+ " String!";/.test(code)
/a = a \+ 1;/.test(__helpers.removeJSComments(code)) &&
/b = b \+ 5;/.test(__helpers.removeJSComments(code)) &&
/c = c \+ " String!";/.test(__helpers.removeJSComments(code))
);
```

View File

@@ -39,7 +39,7 @@ assert(/happy coder/gi.test(myDog.name));
No debes editar la definición de `myDog`.
```js
assert(/"name": "Coder"/.test(code));
assert(/"name": "Coder"/.test(__helpers.removeJSComments(code)));
```
# --seed--

View File

@@ -41,7 +41,7 @@ assert(firstLetterOfLastName === 'L');
Debes usar la notación de corchetes.
```js
assert(code.match(/firstLetterOfLastName\s*=\s*lastName\s*\[\s*\d\s*\]/));
assert(__helpers.removeJSComments(code).match(/firstLetterOfLastName\s*=\s*lastName\s*\[\s*\d\s*\]/));
```
# --seed--

View File

@@ -39,7 +39,7 @@ assert(lastLetterOfLastName === 'e');
Debes usar `.length` para obtener la última letra.
```js
assert(code.match(/\.length/g).length > 0);
assert(__helpers.removeJSComments(code).match(/\.length/g).length > 0);
```
# --seed--

View File

@@ -39,7 +39,7 @@ assert(thirdLetterOfLastName === 'v');
Debes usar la notación de corchetes.
```js
assert(code.match(/thirdLetterOfLastName\s*=\s*lastName\s*\[\s*\d\s*\]/));
assert(__helpers.removeJSComments(code).match(/thirdLetterOfLastName\s*=\s*lastName\s*\[\s*\d\s*\]/));
```
# --seed--

View File

@@ -39,7 +39,7 @@ assert(secondToLastLetterOfLastName === 'c');
Debes usar `.length` para obtener la penúltima letra.
```js
assert(code.match(/\.length/g).length > 0);
assert(__helpers.removeJSComments(code).match(/\.length/g).length > 0);
```
# --seed--

View File

@@ -54,7 +54,7 @@ En la función `checkSign`, usa múltiples operadores condicionales (siguiendo e
`checkSign` debe utilizar múltiples operadores condicionales
```js
assert(/.+?\s*?\?\s*?.+?\s*?:\s*?.+?\s*?\?\s*?.+?\s*?:\s*?.+?/gi.test(code));
assert(/.+?\s*?\?\s*?.+?\s*?:\s*?.+?\s*?\?\s*?.+?\s*?:\s*?.+?/gi.test(__helpers.removeJSComments(code)));
```
`checkSign(10)` debe devolver la cadena `positive`. Ten en cuenta que la capitalización importa

View File

@@ -59,7 +59,7 @@ Tu código no debe depender de ningún tipo de bucles (`for`, `while` o funcione
```js
assert(
!code.match(/for|while|forEach|map|filter|reduce/g)
!__helpers.removeJSComments(code).match(/for|while|forEach|map|filter|reduce/g)
);
```

View File

@@ -26,7 +26,7 @@ Tu código no debe utilizar bucles (`for`, `while` o funciones de orden superior
```js
assert(
!code.match(/for|while|forEach|map|filter|reduce/g)
!__helpers.removeJSComments(code).match(/for|while|forEach|map|filter|reduce/g)
);
```

View File

@@ -42,7 +42,7 @@ Utiliza el operador condicional en la función `checkEqual` para comprobar si do
`checkEqual` debe usar el operador condicional
```js
assert(/.+?\s*?\?\s*?.+?\s*?:\s*?.+?/.test(code));
assert(/.+?\s*?\?\s*?.+?\s*?:\s*?.+?/.test(__helpers.removeJSComments(code)));
```
`checkEqual(1, 2)` debe devolver la cadena `Not Equal`

View File

@@ -34,7 +34,7 @@ Utiliza `parseInt()` en la función `convertToInteger` para convertir un número
`convertToInteger` debe utilizar la función `parseInt()`
```js
assert(/parseInt/g.test(code));
assert(/parseInt/g.test(__helpers.removeJSComments(code)));
```
`convertToInteger("10011")` debe devolver un número

View File

@@ -26,7 +26,7 @@ Utiliza `parseInt()` en la función `convertToInteger` para convertir la cadena
`convertToInteger` debe utilizar la función `parseInt()`
```js
assert(/parseInt/g.test(code));
assert(/parseInt/g.test(__helpers.removeJSComments(code)));
```
`convertToInteger("56")` debe devolver un número

View File

@@ -83,14 +83,14 @@ assert(typeof phoneticLookup('') === 'undefined');
No debes modificar la sentencia `return`
```js
assert(code.match(/return\sresult;/));
assert(__helpers.removeJSComments(code).match(/return\sresult;/));
```
No debes usar sentencias `case`, `switch`o `if`
```js
assert(
!/case|switch|if/g.test(code.replace(/([/]{2}.*)|([/][*][^/*]*[*][/])/g, ''))
!/case|switch|if/g.test(__helpers.removeJSComments(code).replace(/([/]{2}.*)|([/][*][^/*]*[*][/])/g, ''))
);
```

View File

@@ -53,7 +53,7 @@ assert(
No debes utilizar directamente los valores `dog`, `ran`, `big` o `quickly` para crear `wordBlanks`.
```js
const newCode = removeAssignments(code);
const newCode = removeAssignments(__helpers.removeJSComments(code));
assert(
!/dog/.test(newCode) &&
!/ran/.test(newCode) &&

View File

@@ -50,7 +50,7 @@ Debes llamar `reusableFunction` después de definirla.
```js
const functionStr = reusableFunction && __helpers.removeWhiteSpace(reusableFunction.toString());
const codeWithoutFunction = __helpers.removeWhiteSpace(code).replace(/reusableFunction\(\)\{/g, '');
const codeWithoutFunction = __helpers.removeWhiteSpace(__helpers.removeJSComments(code)).replace(/reusableFunction\(\)\{/g, '');
assert(/reusableFunction\(\)/.test(codeWithoutFunction));
```