diff --git a/curriculum/challenges/chinese/01-responsive-web-design/applied-visual-design/use-the-strong-tag-to-make-text-bold.md b/curriculum/challenges/chinese/01-responsive-web-design/applied-visual-design/use-the-strong-tag-to-make-text-bold.md index f1d1641f16..b4e670bbb2 100644 --- a/curriculum/challenges/chinese/01-responsive-web-design/applied-visual-design/use-the-strong-tag-to-make-text-bold.md +++ b/curriculum/challenges/chinese/01-responsive-web-design/applied-visual-design/use-the-strong-tag-to-make-text-bold.md @@ -29,7 +29,7 @@ assert($('strong').length == 1); assert($('p').children('strong').length == 1); ``` -The `strong` tag should wrap around the words `Stanford University`. +`strong` 标签的文本应为 `Stanford University`。 ```js assert( diff --git a/curriculum/challenges/chinese/01-responsive-web-design/basic-css/override-class-declarations-by-styling-id-attributes.md b/curriculum/challenges/chinese/01-responsive-web-design/basic-css/override-class-declarations-by-styling-id-attributes.md index f086d3ea95..2eae74e43c 100644 --- a/curriculum/challenges/chinese/01-responsive-web-design/basic-css/override-class-declarations-by-styling-id-attributes.md +++ b/curriculum/challenges/chinese/01-responsive-web-design/basic-css/override-class-declarations-by-styling-id-attributes.md @@ -31,7 +31,7 @@ dashedName: override-class-declarations-by-styling-id-attributes } ``` -**Note:** 无论在 pink-text class 之前或者之后声明,id 选择器的优先级总是高于 class 选择器。 +**注意:** 无论在 `pink-text` class 之前或者之后声明,`id` 选择器的优先级总是高于 class 选择器。 # --hints-- diff --git a/curriculum/challenges/chinese/01-responsive-web-design/basic-html-and-html5/declare-the-doctype-of-an-html-document.md b/curriculum/challenges/chinese/01-responsive-web-design/basic-html-and-html5/declare-the-doctype-of-an-html-document.md index 26c56c4168..8bb0164f8e 100644 --- a/curriculum/challenges/chinese/01-responsive-web-design/basic-html-and-html5/declare-the-doctype-of-an-html-document.md +++ b/curriculum/challenges/chinese/01-responsive-web-design/basic-html-and-html5/declare-the-doctype-of-an-html-document.md @@ -19,12 +19,12 @@ dashedName: declare-the-doctype-of-an-html-document 所有的 HTML 代码都必须位于 `html` 标签中。 其中 `` 位于 `` 之后,`` 位于网页的结尾。 -以下是网页结构的一个例子: +这是一个网页结构的列子。 你的 HTML 代码会在两个 `html` 标签之间。 ```html - + ``` diff --git a/curriculum/challenges/chinese/01-responsive-web-design/basic-html-and-html5/nest-an-anchor-element-within-a-paragraph.md b/curriculum/challenges/chinese/01-responsive-web-design/basic-html-and-html5/nest-an-anchor-element-within-a-paragraph.md index ad4acbb7cb..dd8fcbaed8 100644 --- a/curriculum/challenges/chinese/01-responsive-web-design/basic-html-and-html5/nest-an-anchor-element-within-a-paragraph.md +++ b/curriculum/challenges/chinese/01-responsive-web-design/basic-html-and-html5/nest-an-anchor-element-within-a-paragraph.md @@ -17,21 +17,33 @@ dashedName: nest-an-anchor-element-within-a-paragraph
``` -我们来分解一下这个示例:普通文本被包裹在 `p` 元素中,例如 -`Here's a ... for you to follow.
` 然后是 *anchor* 元素 ``(要求有一个结束标签 ``): -` ... ` `target` 是一个锚点标签属性,用来指定在哪里打开链接,`_blank` 值指定在一个新的窗口打开链接,`href` 是一个锚点标签属性,包含链接的 URL 地址 -` ... `。`a` 元素中的文本,**“链接到 freecodecamp.org”**,叫作 `anchor text`,将显示一个可点击的链接: -`link to freecodecamp.org`。 这个示例最后输出的结果像这样: +让我们来拆解一下这个例子。 通常,文本是被包裹在 `p` 元素内: -你可以点击这个 [freecodecamp.org 链接](http://freecodecamp.one)。 +`Here's a ... for you to follow.
` + +接下来是*锚点*元素 ``(它需要结束标签 ``): + +` ... ` + +`target` 锚点元素的一个属性,它用来指定链接的打开方式。 属性值 `_blank` 表示链接会在新标签页打开。 `href` 是锚点元素的另一个属性,它用来指定链接的 URL: + +` ... ` + +`a` 元素内的内容文本 `link to freecodecamp.org` 叫作 `anchor text`(锚文本),会显示为一个可以点击的链接: + +`link to freecodecamp.org` + +此示例的最终输出结果是这样: + +你可以访问 [link to freecodecamp.org](http://freecodecamp.org)。 # --instructions-- -创建一个新的段落(`p`)标签来包裹 `main` 元素里的 `a` 节点。 新段落应有文本 `View more cat photos`,其中 `cat photos` 是一个链接,其余是纯文本。 +创建一个新的段落 `p` 元素来包裹 `a` 元素。 新段落标签的内容为 `View more cat photos`,其中 `cat photos` 是一个链接,其余的是纯文本。 # --hints-- -应包含一个链接到 "`https://freecatphotoapp.com`" 的 `a` 元素。 +应包含一个链接到 `https://freecatphotoapp.com` 的 `a` 元素。 ```js assert( @@ -40,7 +52,7 @@ assert( ); ``` -`a` 元素应有锚文本 `cat photos`。 +`a` 元素的内容文本应为 `cat photos`。 ```js assert( @@ -65,7 +77,7 @@ assert( ); ``` -`p` 元素应有文本 `View more`(后面有一个空格)。 +`p` 元素应该包含文本 `View more`(请注意,more 之后有一个空格)。 ```js assert( @@ -80,7 +92,7 @@ assert( ); ``` -`a` 元素 不 应有文本 `View more`。 +`a` 元素中 不 应包含文本 `View more`。 ```js assert( diff --git a/curriculum/challenges/chinese/01-responsive-web-design/responsive-web-design-projects/build-a-personal-portfolio-webpage.md b/curriculum/challenges/chinese/01-responsive-web-design/responsive-web-design-projects/build-a-personal-portfolio-webpage.md index 81edb8c0c2..081b12cbe6 100644 --- a/curriculum/challenges/chinese/01-responsive-web-design/responsive-web-design-projects/build-a-personal-portfolio-webpage.md +++ b/curriculum/challenges/chinese/01-responsive-web-design/responsive-web-design-projects/build-a-personal-portfolio-webpage.md @@ -8,33 +8,33 @@ dashedName: build-a-personal-portfolio-webpage # --description-- -**目标:**在 [CodePen.io](https://codepen.io) 上创建一个与这个功能类似的 app:\\
as an escape character.
+En la cadena goodStr anterior, puedes usar ambas comillas de forma segura usando la barra invertida \\
como un carácter de escape.
-**Note:** The backslash \\
should not be confused with the forward slash `/`. They do not do the same thing.
+**Nota:** La barra invertida \\
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 `` 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 `` 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` (\\
).
+Deberías eliminar todas las barras invertidas `backslashes` (\\
).
```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);
diff --git a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/basic-javascript/store-multiple-values-in-one-variable-using-javascript-arrays.md b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/basic-javascript/store-multiple-values-in-one-variable-using-javascript-arrays.md
index ac96b05987..78cd95a7ce 100644
--- a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/basic-javascript/store-multiple-values-in-one-variable-using-javascript-arrays.md
+++ b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/basic-javascript/store-multiple-values-in-one-variable-using-javascript-arrays.md
@@ -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');
diff --git a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/basic-javascript/storing-values-with-the-assignment-operator.md b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/basic-javascript/storing-values-with-the-assignment-operator.md
index b60c20c275..7e57470e80 100644
--- a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/basic-javascript/storing-values-with-the-assignment-operator.md
+++ b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/basic-javascript/storing-values-with-the-assignment-operator.md
@@ -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 assignment operator (`=`).
+En JavaScript, puedes almacenar un valor en una variable con el operador de asignación (`=`).
`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);
diff --git a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/basic-javascript/understanding-case-sensitivity-in-variables.md b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/basic-javascript/understanding-case-sensitivity-in-variables.md
index e7fcb1247b..a6511980ab 100644
--- a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/basic-javascript/understanding-case-sensitivity-in-variables.md
+++ b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/basic-javascript/understanding-case-sensitivity-in-variables.md
@@ -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 camelCase. In camelCase, 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 camelCase. En camelCase, 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 camelCase.
-Do not create any new variables.
+Modifica las declaraciones y asignaciones existentes para que sus nombres usen camelCase.
+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);
diff --git a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/basic-javascript/use-bracket-notation-to-find-the-last-character-in-a-string.md b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/basic-javascript/use-bracket-notation-to-find-the-last-character-in-a-string.md
index 6643d6d469..0441a0df31 100644
--- a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/basic-javascript/use-bracket-notation-to-find-the-last-character-in-a-string.md
+++ b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/basic-javascript/use-bracket-notation-to-find-the-last-character-in-a-string.md
@@ -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 bracket notation to find the last character in the `lastName` variable.
+Usa notación de corchetes 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);
diff --git a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/debugging/catch-arguments-passed-in-the-wrong-order-when-calling-a-function.md b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/debugging/catch-arguments-passed-in-the-wrong-order-when-calling-a-function.md
index 7aea16b1e6..6fef37db01 100644
--- a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/debugging/catch-arguments-passed-in-the-wrong-order-when-calling-a-function.md
+++ b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/debugging/catch-arguments-passed-in-the-wrong-order-when-calling-a-function.md
@@ -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 función `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));
diff --git a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/debugging/catch-missing-open-and-closing-parenthesis-after-a-function-call.md b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/debugging/catch-missing-open-and-closing-parenthesis-after-a-function-call.md
index 5a4e0fc060..aac6731f1a 100644
--- a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/debugging/catch-missing-open-and-closing-parenthesis-after-a-function-call.md
+++ b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/debugging/catch-missing-open-and-closing-parenthesis-after-a-function-call.md
@@ -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 función 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 función `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 función `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);
diff --git a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/debugging/catch-mixed-usage-of-single-and-double-quotes.md b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/debugging/catch-mixed-usage-of-single-and-double-quotes.md
index cde18db798..319a930402 100644
--- a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/debugging/catch-mixed-usage-of-single-and-double-quotes.md
+++ b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/debugging/catch-mixed-usage-of-single-and-double-quotes.md
@@ -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 (\\
) 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 (\\
):
```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(//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>";/g)); diff --git a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/debugging/catch-use-of-assignment-operator-instead-of-equality-operator.md b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/debugging/catch-use-of-assignment-operator-instead-of-equality-operator.md index e164f37399..b1fafcbd31 100644 --- a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/debugging/catch-use-of-assignment-operator-instead-of-equality-operator.md +++ b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/debugging/catch-use-of-assignment-operator-instead-of-equality-operator.md @@ -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)); diff --git a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/debugging/prevent-infinite-loops-with-a-valid-terminal-condition.md b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/debugging/prevent-infinite-loops-with-a-valid-terminal-condition.md index 9455e13645..88f47514c0 100644 --- a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/debugging/prevent-infinite-loops-with-a-valid-terminal-condition.md +++ b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/debugging/prevent-infinite-loops-with-a-valid-terminal-condition.md @@ -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 función! ```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)); diff --git a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/debugging/use-caution-when-reinitializing-variables-inside-a-loop.md b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/debugging/use-caution-when-reinitializing-variables-inside-a-loop.md index 19dd59b605..b392d7780a 100644 --- a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/debugging/use-caution-when-reinitializing-variables-inside-a-loop.md +++ b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/debugging/use-caution-when-reinitializing-variables-inside-a-loop.md @@ -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( diff --git a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/debugging/use-the-javascript-console-to-check-the-value-of-a-variable.md b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/debugging/use-the-javascript-console-to-check-the-value-of-a-variable.md index eba2284614..bfeecb112e 100644 --- a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/debugging/use-the-javascript-console-to-check-the-value-of-a-variable.md +++ b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/debugging/use-the-javascript-console-to-check-the-value-of-a-variable.md @@ -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)); diff --git a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/debugging/use-typeof-to-check-the-type-of-a-variable.md b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/debugging/use-typeof-to-check-the-type-of-a-variable.md index e9d54bfb66..b69881e663 100644 --- a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/debugging/use-typeof-to-check-the-type-of-a-variable.md +++ b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/debugging/use-typeof-to-check-the-type-of-a-variable.md @@ -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));