chore(i8n,learn): processed translations (#41197)

Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
This commit is contained in:
Randell Dawson
2021-02-21 08:49:16 -07:00
committed by GitHub
parent fd7b63c8d7
commit a0a7598c44
39 changed files with 362 additions and 350 deletions

View File

@ -1,6 +1,6 @@
---
id: 587d7b85367417b2b2512b3a
title: Catch Arguments Passed in the Wrong Order When Calling a Function
title: Captura argumentos pasados en el orden incorrecto al llamar a una función
challengeType: 1
forumTopicId: 301184
dashedName: catch-arguments-passed-in-the-wrong-order-when-calling-a-function
@ -8,21 +8,21 @@ dashedName: catch-arguments-passed-in-the-wrong-order-when-calling-a-function
# --description--
Continuing the discussion on calling functions, the next bug to watch out for is when a function's arguments are supplied in the incorrect order. If the arguments are different types, such as a function expecting an array and an integer, this will likely throw a runtime error. If the arguments are the same type (all integers, for example), then the logic of the code won't make sense. Make sure to supply all required arguments, in the proper order to avoid these issues.
Siguiendo con la discusión sobre la llamada a funciones, el siguiente error a tener en cuenta es cuando los argumentos de una función se suministran en el orden incorrecto. Si los argumentos son de tipos diferentes, como una función que espera un arreglo y un entero, es probable que se produzca un error de ejecución. Si los argumentos son del mismo tipo (todos enteros, por ejemplo), la lógica del código no tendrá sentido. Asegúrate de proporcionar todos los argumentos requeridos, en el orden correcto para evitar estos problemas.
# --instructions--
The function `raiseToPower` raises a base to an exponent. Unfortunately, it's not called properly - fix the code so the value of `power` is the expected 8.
La funcn `raiseToPower` eleva una base a un exponente. Desafortunadamente, no se llama correctamente - corrige el código para que el valor de `power` sea el 8 esperado.
# --hints--
Your code should fix the variable `power` so it equals 2 raised to the 3rd power, not 3 raised to the 2nd power.
Tu código debe arreglar la variable `power` para que sea igual a 2 elevado a la 3ª potencia, no a 3 elevado a la 2ª potencia.
```js
assert(power == 8);
```
Your code should use the correct order of the arguments for the `raiseToPower` function call.
Tu código debe utilizar el orden correcto de los argumentos para la llamada a la función `raiseToPower`.
```js
assert(code.match(/raiseToPower\(\s*?base\s*?,\s*?exp\s*?\);/g));

View File

@ -1,6 +1,6 @@
---
id: 587d7b85367417b2b2512b39
title: Catch Missing Open and Closing Parenthesis After a Function Call
title: Captura los paréntesis de apertura y cierre que faltan después de una llamada a una función
challengeType: 1
forumTopicId: 301185
dashedName: catch-missing-open-and-closing-parenthesis-after-a-function-call
@ -8,9 +8,9 @@ dashedName: catch-missing-open-and-closing-parenthesis-after-a-function-call
# --description--
When a function or method doesn't take any arguments, you may forget to include the (empty) opening and closing parentheses when calling it. Often times the result of a function call is saved in a variable for other use in your code. This error can be detected by logging variable values (or their types) to the console and seeing that one is set to a function reference, instead of the expected value the function returns.
Cuando una funcn o método no recibe argumentos, puedes olvidarte de incluir los paréntesis de apertura y cierre (vacíos) al llamarla. A menudo, el resultado de una llamada a una función se guarda en una variable para su uso en el código. Este error puede detectarse registrando los valores de las variables (o sus tipos) en la consola y viendo que uno de ellos se establece como una referencia a la función, en lugar del valor esperado que la función devuelve.
The variables in the following example are different:
Las variables del siguiente ejemplo son diferentes:
```js
function myFunction() {
@ -22,17 +22,17 @@ let varTwo = myFunction(); // set to equal the string "You rock!"
# --instructions--
Fix the code so the variable `result` is set to the value returned from calling the function `getNine`.
Corrige el código para que la variable `result` se establezca en el valor devuelto al llamar a la funcn `getNine`.
# --hints--
Your code should fix the variable `result` so it is set to the number that the function `getNine` returns.
Tu código debe corregir la variable `result` para que se establezca en el número que devuelve la funcn `getNine`.
```js
assert(result == 9);
```
Your code should call the `getNine` function.
Tu código debe llamar a la función `getNine`.
```js
assert(code.match(/getNine\(\)/g).length == 2);

View File

@ -1,6 +1,6 @@
---
id: 587d7b84367417b2b2512b37
title: Catch Mixed Usage of Single and Double Quotes
title: Captura el uso mixto de comillas simples y dobles
challengeType: 1
forumTopicId: 301188
dashedName: catch-mixed-usage-of-single-and-double-quotes
@ -8,11 +8,11 @@ dashedName: catch-mixed-usage-of-single-and-double-quotes
# --description--
JavaScript allows the use of both single (`'`) and double (`"`) quotes to declare a string. Deciding which one to use generally comes down to personal preference, with some exceptions.
JavaScript permite el uso de comillas simples (`'`) y dobles (`"`) para declarar una cadena. Decidir cuál usar se reduce generalmente a la preferencia personal, con algunas excepciones.
Having two choices is great when a string has contractions or another piece of text that's in quotes. Just be careful that you don't close the string too early, which causes a syntax error.
Tener dos opciones es genial cuando una cadena tiene contracciones u otro fragmento de texto que está entre comillas. Sólo hay que tener cuidado de no cerrar la cadena demasiado pronto, lo que provoca un error de sintaxis.
Here are some examples of mixing quotes:
Aquí hay algunos ejemplos de comillas mezcladas:
```js
// These are correct:
@ -22,7 +22,7 @@ const quoteInString = "Groucho Marx once said 'Quote me as saying I was mis-quot
const uhOhGroucho = 'I've had a perfectly wonderful evening, but this wasn't it.';
```
Of course, it is okay to use only one style of quotes. You can escape the quotes inside the string by using the backslash (<code>\\</code>) escape character:
Por supuesto, está bien utilizar sólo un estilo de comillas. Puedes realizar un escape de las comillas dentro de la cadena utilizando el caracter de escape de la barra invertida (<code>\\</code>):
```js
// Correct use of same quotes:
@ -31,17 +31,17 @@ const allSameQuotes = 'I\'ve had a perfectly wonderful evening, but this wasn\'t
# --instructions--
Fix the string so it either uses different quotes for the `href` value, or escape the existing ones. Keep the double quote marks around the entire string.
Corrige la cadena para que use comillas diferentes para el valor de `href`, o realiza un escape de las existentes. Mantén las comillas dobles alrededor de toda la cadena.
# --hints--
Your code should fix the quotes around the `href` value "#Home" by either changing or escaping them.
Tu código debe corregir las comillas alrededor del valor `href` "#Home" cambiándolas o escapándolas.
```js
assert(code.match(/<a href=\s*?('|\\")#Home\1\s*?>/g));
```
Your code should keep the double quotes around the entire string.
Tu código debe mantener las comillas dobles alrededor de toda la cadena.
```js
assert(code.match(/"<p>.*?<\/p>";/g));

View File

@ -1,6 +1,6 @@
---
id: 587d7b85367417b2b2512b38
title: Catch Use of Assignment Operator Instead of Equality Operator
title: Captura el uso del operador de asignación en lugar del operador de igualdad
challengeType: 1
forumTopicId: 301191
dashedName: catch-use-of-assignment-operator-instead-of-equality-operator
@ -8,13 +8,13 @@ dashedName: catch-use-of-assignment-operator-instead-of-equality-operator
# --description--
Branching programs, i.e. ones that do different things if certain conditions are met, rely on `if`, `else if`, and `else` statements in JavaScript. The condition sometimes takes the form of testing whether a result is equal to a value.
Los programas de bifurcación (branching), es decir, los que hacen cosas diferentes si se cumplen ciertas condiciones, se basan en las sentencias `if`, `else if` y `else` de JavaScript. La condición a veces toma la forma de probar si un resultado es igual a un valor.
This logic is spoken (in English, at least) as "if x equals y, then ..." which can literally translate into code using the `=`, or assignment operator. This leads to unexpected control flow in your program.
Esta lógica se habla (en español, al menos) como "si x es igual a y, entonces...", lo que puede traducirse literalmente en código utilizando el `=`, u operador de asignación. Esto lleva a un flujo de control inesperado en tu programa.
As covered in previous challenges, the assignment operator (`=`) in JavaScript assigns a value to a variable name. And the `==` and `===` operators check for equality (the triple `===` tests for strict equality, meaning both value and type are the same).
Como hemos visto en desafíos anteriores, el operador de asignación (`=`) en JavaScript asigna un valor a una variable. Y los operadores `==` y `===` comprueban la igualdad (el triple `===` comprueba la igualdad estricta, lo que significa que tanto el valor como el tipo son iguales).
The code below assigns `x` to be 2, which evaluates as `true`. Almost every value on its own in JavaScript evaluates to `true`, except what are known as the "falsy" values: `false`, `0`, `""` (an empty string), `NaN`, `undefined`, and `null`.
El código siguiente asigna a `x` el valor de 2, que se evalúa como `true`. Casi todos los valores por sí solos en JavaScript se evalúan como `true`, excepto lo que se conoce como valores "falsos" (falsy values): `false`, `0`, `""` (una cadena vacía), `NaN`, `undefined`, y `null`.
```js
let x = 1;
@ -28,17 +28,17 @@ if (x = y) {
# --instructions--
Fix the condition so the program runs the right branch, and the appropriate value is assigned to `result`.
Corrige la condición para que el programa ejecute la rama correcta y se asigne el valor adecuado a `result`.
# --hints--
Your code should fix the condition so it checks for equality, instead of using assignment.
Tu código debe corregir la condición para que compruebe igualdad, en lugar de utilizar asignación.
```js
assert(result == 'Not equal!');
```
The condition should use either `==` or `===` to test for equality.
La condición debe utilizar `==` o `===` para comprobar igualdad.
```js
assert(code.match(/x\s*?===?\s*?y/g));

View File

@ -1,6 +1,6 @@
---
id: 587d7b86367417b2b2512b3d
title: Prevent Infinite Loops with a Valid Terminal Condition
title: Prevenir bucles infinitos con una condición terminal válida
challengeType: 1
forumTopicId: 301192
dashedName: prevent-infinite-loops-with-a-valid-terminal-condition
@ -8,9 +8,9 @@ dashedName: prevent-infinite-loops-with-a-valid-terminal-condition
# --description--
The final topic is the dreaded infinite loop. Loops are great tools when you need your program to run a code block a certain number of times or until a condition is met, but they need a terminal condition that ends the looping. Infinite loops are likely to freeze or crash the browser, and cause general program execution mayhem, which no one wants.
El último tema es el temido bucle infinito. Los bucles son una gran herramienta cuando necesitas que tu programa ejecute un bloque de código un determinado número de veces o hasta que se cumpla una condición, pero necesitan una condición terminal para que finalice el bucle. Los bucles infinitos pueden congelar o bloquear el navegador, y causar un caos en la ejecución del programa en general, lo que nadie quiere.
There was an example of an infinite loop in the introduction to this section - it had no terminal condition to break out of the `while` loop inside `loopy()`. Do NOT call this function!
Había un ejemplo de un bucle infinito en la introducción de esta sección - no tenía ninguna condición terminal para salir del bucle `while` dentro de `loopy()`. ¡NO llames a esta funcn!
```js
function loopy() {
@ -20,21 +20,21 @@ function loopy() {
}
```
It's the programmer's job to ensure that the terminal condition, which tells the program when to break out of the loop code, is eventually reached. One error is incrementing or decrementing a counter variable in the wrong direction from the terminal condition. Another one is accidentally resetting a counter or index variable within the loop code, instead of incrementing or decrementing it.
El trabajo del programador es asegurarse de que la condición terminal, que indica al programa cuándo debe salir del código del bucle, se alcance finalmente. Un error es incrementar o decrementar una variable de contador en la dirección incorrecta desde la condición terminal. Otra es reiniciar accidentalmente un contador o una variable de índice dentro del código del bucle, en lugar de incrementarlo o decrementarlo.
# --instructions--
The `myFunc()` function contains an infinite loop because the terminal condition `i != 4` will never evaluate to `false` (and break the looping) - `i` will increment by 2 each pass, and jump right over 4 since `i` is odd to start. Fix the comparison operator in the terminal condition so the loop only runs for `i` less than or equal to 4.
La función `myFunc()` contiene un bucle infinito porque la condición terminal `i != 4` nunca se evaluará a `false` (y romperá el bucle) - `i` se incrementará en 2 en cada pasada, y saltará justo sobre 4, ya que `i` es impar para empezar. Corrige el operador de comparación en la condición terminal para que el bucle sólo se ejecute para `i` menor o igual a 4.
# --hints--
Your code should change the comparison operator in the terminal condition (the middle part) of the `for` loop.
Tu código debe cambiar el operador de comparación en la condición terminal (la parte central) del bucle `for`.
```js
assert(code.match(/i\s*?<=\s*?4;/g).length == 1);
```
Your code should fix the comparison operator in the terminal condition of the loop.
Tu código debe corregir el operador de comparación en la condición terminal del bucle.
```js
assert(!code.match(/i\s*?!=\s*?4;/g));

View File

@ -1,6 +1,6 @@
---
id: 587d7b86367417b2b2512b3c
title: Use Caution When Reinitializing Variables Inside a Loop
title: Ten cuidado al reinicializar variables dentro de un bucle
challengeType: 1
forumTopicId: 301194
dashedName: use-caution-when-reinitializing-variables-inside-a-loop
@ -8,29 +8,29 @@ dashedName: use-caution-when-reinitializing-variables-inside-a-loop
# --description--
Sometimes it's necessary to save information, increment counters, or re-set variables within a loop. A potential issue is when variables either should be reinitialized, and aren't, or vice versa. This is particularly dangerous if you accidentally reset the variable being used for the terminal condition, causing an infinite loop.
A veces es necesario guardar información, incrementar contadores o reajustar variables dentro de un bucle. Un problema potencial es cuando las variables deberían ser reiniciadas y no lo son, o viceversa. Esto es particularmente peligroso si accidentalmente se restablece la variable que se utiliza para la condición terminal, causando un bucle infinito.
Printing variable values with each cycle of your loop by using `console.log()` can uncover buggy behavior related to resetting, or failing to reset a variable.
La impresión de los valores de las variables con cada ciclo de su bucle mediante el uso de `console.log()` puede descubrir un comportamiento erróneo relacionado con el restablecimiento, o la falta de restablecimiento de una variable.
# --instructions--
The following function is supposed to create a two-dimensional array with `m` rows and `n` columns of zeroes. Unfortunately, it's not producing the expected output because the `row` variable isn't being reinitialized (set back to an empty array) in the outer loop. Fix the code so it returns a correct 3x2 array of zeroes, which looks like `[[0, 0], [0, 0], [0, 0]]`.
La siguiente función debe crear un arreglo bidimensional (matriz) con `m` filas (rows) y `n` columnas (columns) de ceros. Desafortunadamente, no está produciendo la salida esperada porque la variable `row` no está siendo reiniciada (devuelta a un arreglo vacío) en el bucle exterior. Corrige el código para que devuelva una matriz 3x2 de ceros correcta, que se parezca a `[[0, 0], [0, 0], [0, 0]]`.
# --hints--
Your code should set the `matrix` variable to an array holding 3 rows of 2 columns of zeroes each.
Tu código debe establecer la variable `matrix` en una matriz que contenga 3 filas de 2 columnas de ceros cada una.
```js
assert(JSON.stringify(matrix) == '[[0,0],[0,0],[0,0]]');
```
The `matrix` variable should have 3 rows.
La variable `matrix` debe tener 3 filas.
```js
assert(matrix.length == 3);
```
The `matrix` variable should have 2 columns in each row.
La variable `matrix` debe tener 2 columnas en cada fila.
```js
assert(

View File

@ -1,6 +1,6 @@
---
id: 587d7b83367417b2b2512b33
title: Use the JavaScript Console to Check the Value of a Variable
title: Usa la consola de JavaScript para comprobar el valor de una variable
challengeType: 1
forumTopicId: 18372
dashedName: use-the-javascript-console-to-check-the-value-of-a-variable
@ -8,23 +8,23 @@ dashedName: use-the-javascript-console-to-check-the-value-of-a-variable
# --description--
Both Chrome and Firefox have excellent JavaScript consoles, also known as DevTools, for debugging your JavaScript.
Tanto Chrome como Firefox tienen excelentes consolas de JavaScript, también conocidas como DevTools, para depurar tu JavaScript.
You can find Developer tools in your Chrome's menu or Web Console in Firefox's menu. If you're using a different browser, or a mobile phone, we strongly recommend switching to desktop Firefox or Chrome.
Puedes encontrar las herramientas para desarrolladores en el menú de Chrome o la consola web en el menú de Firefox. Si utilizas otro navegador, o un teléfono móvil, te recomendamos encarecidamente que cambies a Firefox o Chrome de escritorio.
The `console.log()` method, which "prints" the output of what's within its parentheses to the console, will likely be the most helpful debugging tool. Placing it at strategic points in your code can show you the intermediate values of variables. It's good practice to have an idea of what the output should be before looking at what it is. Having check points to see the status of your calculations throughout your code will help narrow down where the problem is.
El método `console.log()`, que "imprime" la salida de lo que está dentro de sus paréntesis a la consola, será probablemente la herramienta de depuración más útil. Colocarlo en puntos estratégicos de tu código puede mostrarte los valores intermedios de las variables. Es una buena práctica tener una idea de lo que debería ser la salida antes de ver lo que es. Tener puntos de control para ver el estado de tus cálculos a lo largo de tu código ayudará a acotar dónde está el problema.
Here's an example to print 'Hello world!' to the console:
Este es un ejemplo para imprimir "Hello world!" en la consola:
`console.log('Hello world!');`
# --instructions--
Use the `console.log()` method to print the value of the variable `a` where noted in the code.
Utiliza el método `console.log()` para imprimir el valor de la variable `a` donde se indica en el código.
# --hints--
Your code should use `console.log()` to check the value of the variable `a`.
Tu código debe utilizar `console.log()` para comprobar el valor de la variable `a`.
```js
assert(code.match(/console\.log\(a\)/g));

View File

@ -1,6 +1,6 @@
---
id: 587d7b84367417b2b2512b34
title: Use typeof to Check the Type of a Variable
title: Utiliza typeof para comprobar el tipo de una variable
challengeType: 1
forumTopicId: 18374
dashedName: use-typeof-to-check-the-type-of-a-variable
@ -8,9 +8,9 @@ dashedName: use-typeof-to-check-the-type-of-a-variable
# --description--
You can use `typeof` to check the data structure, or type, of a variable. This is useful in debugging when working with multiple data types. If you think you're adding two numbers, but one is actually a string, the results can be unexpected. Type errors can lurk in calculations or function calls. Be careful especially when you're accessing and working with external data in the form of a JavaScript Object Notation (JSON) object.
Puedes utilizar `typeof` para comprobar la estructura de datos, o tipo, de una variable. Esto es útil en la depuración cuando se trabaja con múltiples tipos de datos. Si crees que estás sumando dos números, pero uno es en realidad una cadena, los resultados pueden ser inesperados. Los errores de tipo pueden estar al acecho en los cálculos o en las llamadas a funciones. Ten cuidado especialmente cuando accedas y trabajes con datos externos en forma de objeto de JavaScript Object Notation (JSON).
Here are some examples using `typeof`:
Aquí hay algunos ejemplos que utilizan `typeof`:
```js
console.log(typeof ""); // outputs "string"
@ -19,27 +19,27 @@ console.log(typeof []); // outputs "object"
console.log(typeof {}); // outputs "object"
```
JavaScript recognizes six primitive (immutable) data types: `Boolean`, `Null`, `Undefined`, `Number`, `String`, and `Symbol` (new with ES6) and one type for mutable items: `Object`. Note that in JavaScript, arrays are technically a type of object.
JavaScript reconoce seis tipos de datos primitivos (inmutables): `Boolean`, `Null`, `Undefined`, `Number`, `String`, y `Symbol` (nuevo con ES6) y un tipo para elementos mutables: `Object`. Ten en cuenta que en JavaScript, los arreglos son técnicamente un tipo de objeto.
# --instructions--
Add two `console.log()` statements to check the `typeof` each of the two variables `seven` and `three` in the code.
Agrega dos sentencias `console.log()` para comprobar el `typeof` de cada una de las dos variables `seven` y `three` en el código.
# --hints--
Your code should use `typeof` in two `console.log()` statements to check the type of the variables.
Tu código debe utilizar `typeof` en dos sentencias `console.log()` para comprobar el tipo de las variables.
```js
assert(code.match(/console\.log\(typeof[\( ].*\)?\)/g).length == 2);
```
Your code should use `typeof` to check the type of the variable `seven`.
Tu código debe utilizar `typeof` para comprobar el tipo de la variable `seven`.
```js
assert(code.match(/typeof[\( ]seven\)?/g));
```
Your code should use `typeof` to check the type of the variable `three`.
Tu código debe utilizar `typeof` para comprobar el tipo de la variable `three`.
```js
assert(code.match(/typeof[\( ]three\)?/g));