From 08caf09e5c50ff17af0139878cabd383228b6bbb Mon Sep 17 00:00:00 2001 From: CamperBot Date: Mon, 29 Mar 2021 22:47:35 +0900 Subject: [PATCH] chore(i8n,curriculum): processed translations (#41617) Co-authored-by: Crowdin Bot --- .../use-rgb-values-to-color-elements.md | 4 +-- ...d-new-properties-to-a-javascript-object.md | 14 +++++--- .../assignment-with-a-returned-value.md | 10 +++--- ...ound-assignment-with-augmented-addition.md | 4 ++- .../count-backwards-with-a-for-loop.md | 2 +- .../basic-javascript/counting-cards.md | 4 +-- .../decrement-a-number-with-javascript.md | 12 ++++--- ...ete-properties-from-a-javascript-object.md | 4 ++- .../escaping-literal-quotes-in-strings.md | 12 +++++-- .../basic-javascript/shopping-list.md | 4 ++- ...in-one-variable-using-javascript-arrays.md | 4 ++- ...ing-values-with-the-assignment-operator.md | 4 ++- .../use-the-parseint-function-with-a-radix.md | 12 ++++--- .../use-the-parseint-function.md | 4 ++- ...xtend-constructors-to-receive-arguments.md | 26 +++++++------- .../inherit-behaviors-from-a-supertype.md | 30 ++++++++-------- .../iterate-over-all-properties.md | 20 ++++++----- .../override-inherited-methods.md | 26 +++++++------- ...reset-an-inherited-constructor-property.md | 22 ++++++------ .../match-anything-with-wildcard-period.md | 34 ++++++++++--------- .../match-beginning-string-patterns.md | 20 +++++------ ...characters-that-occur-one-or-more-times.md | 18 +++++----- ...haracters-that-occur-zero-or-more-times.md | 28 ++++++++------- .../match-ending-string-patterns.md | 19 +++++------ 24 files changed, 186 insertions(+), 151 deletions(-) diff --git a/curriculum/challenges/espanol/01-responsive-web-design/basic-css/use-rgb-values-to-color-elements.md b/curriculum/challenges/espanol/01-responsive-web-design/basic-css/use-rgb-values-to-color-elements.md index 76727ef50b..6c4d18dc53 100644 --- a/curriculum/challenges/espanol/01-responsive-web-design/basic-css/use-rgb-values-to-color-elements.md +++ b/curriculum/challenges/espanol/01-responsive-web-design/basic-css/use-rgb-values-to-color-elements.md @@ -27,7 +27,7 @@ En lugar de usar seis dígitos hexadecimales, como hacemos con el código hexade Si haces el cálculo, cada uno de los dos dígitos para un color representa 16 combinaciones, lo que nos da 256 valores posibles. Entonces, `RGB`, que comienza a contar desde cero, tiene el mismo número exacto de valores posibles que el código hexadecimal. -A continuación puedes ver un ejemplo de cómo cambiar el color de fondo de "body" a naranja usando su código RGB. +A continuación puedes ver un ejemplo de cómo cambiar el color de fondo de `body` a naranja usando su código RGB. ```css body { @@ -47,7 +47,7 @@ Tu elemento `body` debe tener un color de fondo "black" (negro). assert($('body').css('background-color') === 'rgb(0, 0, 0)'); ``` -Debes usar `rgb` para asignar a tu elemento `body` el color negro. +Debes usar `rgb` para asignar a tu elemento `body` un color de fondo de negro. ```js assert(code.match(/rgb\s*\(\s*0\s*,\s*0\s*,\s*0\s*\)/gi)); diff --git a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/basic-javascript/add-new-properties-to-a-javascript-object.md b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/basic-javascript/add-new-properties-to-a-javascript-object.md index 2ce339bec5..8b1940ed62 100644 --- a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/basic-javascript/add-new-properties-to-a-javascript-object.md +++ b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/basic-javascript/add-new-properties-to-a-javascript-object.md @@ -13,15 +13,19 @@ Puedes añadir nuevas propiedades a los objetos de JavaScript existentes de la m Así es como podríamos agregar una propiedad `bark` a nuestro objeto `ourDog`: -`ourDog.bark = "bow-wow";` +```js +ourDog.bark = "bow-wow"; +``` o -`ourDog["bark"] = "bow-wow";` +```js +ourDog["bark"] = "bow-wow"; +``` Ahora cuando evaluemos `ourDog.bark`, obtendremos su ladrido, `bow-wow`. -Ejemplo: +Por ejemplo: ```js var ourDog = { @@ -36,7 +40,7 @@ ourDog.bark = "bow-wow"; # --instructions-- -Añade una propiedad `bark` a `myDog` y establécela a un sonido de perro, como "guau". Puedes usar tanto la notación de puntos como la notación de corchetes. +Añade una propiedad `bark` a `myDog` y establécela a un sonido de perro, como "woof". Puedes usar tanto la notación de puntos como la notación de corchetes. # --hints-- @@ -46,7 +50,7 @@ Debes agregar la propiedad `bark` a `myDog`. assert(myDog.bark !== undefined); ``` -No debes agregar `bark` a la sección de configuración (setup). +No debes agregar `bark` a la sección de configuración. ```js assert(!/bark[^\n]:/.test(code)); diff --git a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/basic-javascript/assignment-with-a-returned-value.md b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/basic-javascript/assignment-with-a-returned-value.md index 312aa4183c..51523e495b 100644 --- a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/basic-javascript/assignment-with-a-returned-value.md +++ b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/basic-javascript/assignment-with-a-returned-value.md @@ -13,13 +13,15 @@ Si recuerdas de nuestra discusión sobre [almacenar valores con el operador de a Supongamos que hemos predefinido una función `sum` que suma dos números juntos, entonces: -`ourSum = sum(5, 12);` +```js +ourSum = sum(5, 12); +``` -llamará a la función `sum`, la cual devuelve un valor de `17` y lo asigna a la variable `ourSum`. +llamará a la función `sum`, que devuelve un valor de `17` y lo asigna a la variable `ourSum`. # --instructions-- -Llama a la función `processArg` con un argumento de `7` y asigna su valor devuelto a la variable `processed`. +Llama la función `processArg` con un argumento de `7` y asigna su valor de retorno a la variable `processed`. # --hints-- @@ -29,7 +31,7 @@ Llama a la función `processArg` con un argumento de `7` y asigna su valor devue assert(processed === 2); ``` -Debes asignar `processArg` a `processed` +Debes asignar `processArg` para `processed` ```js assert(/processed\s*=\s*processArg\(\s*7\s*\)/.test(code)); diff --git a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/basic-javascript/compound-assignment-with-augmented-addition.md b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/basic-javascript/compound-assignment-with-augmented-addition.md index 0836929d23..555340698a 100644 --- a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/basic-javascript/compound-assignment-with-augmented-addition.md +++ b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/basic-javascript/compound-assignment-with-augmented-addition.md @@ -11,7 +11,9 @@ dashedName: compound-assignment-with-augmented-addition En la programación, es común utilizar asignaciones para modificar el contenido de una variable. Recuerda que todo lo que está a la derecha del signo de igualdad se evalúa primero, así que podemos decir: -`myVar = myVar + 5;` +```js +myVar = myVar + 5; +``` para sumar `5` a `myVar`. Dado que se trata de un patrón tan común, hay operadores que hacen tanto la operación matemática como la asignación en un solo paso. diff --git a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/basic-javascript/count-backwards-with-a-for-loop.md b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/basic-javascript/count-backwards-with-a-for-loop.md index d679a51ea2..897f376d74 100644 --- a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/basic-javascript/count-backwards-with-a-for-loop.md +++ b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/basic-javascript/count-backwards-with-a-for-loop.md @@ -22,7 +22,7 @@ for (var i = 10; i > 0; i -= 2) { } ``` -`ourArray` ahora contendrá `[10,8,6,4,2]`. Cambiemos nuestra inicialización y expresión final para que podamos contar hacia atrás por dos números impares. +`ourArray` ahora contendrá `[10,8,6,4,2]`. Ahora cambiemos el valor de inicialización y la expresión final de nuestro bucle para que podamos contar hacia atrás de dos en dos y así crear un arreglo descendente de números impares. # --instructions-- diff --git a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/basic-javascript/counting-cards.md b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/basic-javascript/counting-cards.md index 8c88443d07..612575d9c2 100644 --- a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/basic-javascript/counting-cards.md +++ b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/basic-javascript/counting-cards.md @@ -17,9 +17,7 @@ Tener más cartas altas en la baraja es una ventaja para el jugador. Se le asign Escribirás una función para contar cartas. Recibirá un parámetro `card` (carta) que puede ser un número o una cadena y aumentar o reducir la variable global `count` (conteo) de acuerdo al valor de la carta (observa la tabla). La función devolverá una cadena con el conteo actual y la cadena `Bet` (Apuesta) si el conteo es positivo, o `Hold` (Espera) si el conteo es cero o negativo. El conteo actual y la decisión del jugador (`Bet` o `Hold`) deben estar separados por un solo espacio. -**Ejemplo de salida** -`-3 Hold` -`5 Bet` +**Resultados de ejemplo:** `-3 Hold` o `5 Bet` **Sugerencia** NO reinicies `count` a 0 cuando el valor sea 7, 8 o 9. NO devuelvas un arreglo. diff --git a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/basic-javascript/decrement-a-number-with-javascript.md b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/basic-javascript/decrement-a-number-with-javascript.md index 5d43991d1d..68a2a9a651 100644 --- a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/basic-javascript/decrement-a-number-with-javascript.md +++ b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/basic-javascript/decrement-a-number-with-javascript.md @@ -11,13 +11,17 @@ dashedName: decrement-a-number-with-javascript Puedes fácilmente decrementar o disminuir una variable por uno utilizando el operador `--`. -`i--;` +```js +i--; +``` -es equivalente a +es el equivalente de -`i = i - 1;` +```js +i = i - 1; +``` -**Nota:** Toda la línea se convierte en `i--;`, eliminando la necesidad del signo de igualdad. +**Nota:** La linea se convierte en `i--;`, eliminando la necesidad del signo igual. # --instructions-- diff --git a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/basic-javascript/delete-properties-from-a-javascript-object.md b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/basic-javascript/delete-properties-from-a-javascript-object.md index e6969a25b7..4b06a101da 100644 --- a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/basic-javascript/delete-properties-from-a-javascript-object.md +++ b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/basic-javascript/delete-properties-from-a-javascript-object.md @@ -11,7 +11,9 @@ dashedName: delete-properties-from-a-javascript-object También podemos eliminar propiedades de objetos de esta forma: -`delete ourDog.bark;` +```js +delete ourDog.bark; +``` Ejemplo: diff --git a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/basic-javascript/escaping-literal-quotes-in-strings.md b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/basic-javascript/escaping-literal-quotes-in-strings.md index 8244b432c2..e3414cf46c 100644 --- a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/basic-javascript/escaping-literal-quotes-in-strings.md +++ b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/basic-javascript/escaping-literal-quotes-in-strings.md @@ -13,17 +13,23 @@ Cuando estás definiendo una cadena debes comenzar y terminar con una comilla si En JavaScript, puedes escapar una comilla de considerarse un final de cadena colocando una barra invertida (`\`) delante de la comilla. -`var sampleStr = "Alan said, \"Peter is learning JavaScript\".";` +```js +var sampleStr = "Alan said, \"Peter is learning JavaScript\"."; +``` Esto indica a JavaScript que la siguiente comilla no es el final de la cadena, sino que debería aparecer dentro de la cadena. Así que si imprimieras esto en la consola, obtendrías: -`Alan said, "Peter is learning JavaScript".` +```js +Alan said, "Peter is learning JavaScript". +``` # --instructions-- Usa barras invertidas para asignar una cadena a la variable `myStr` de modo que si lo imprimieras en la consola, verías: -`I am a "double quoted" string inside "double quotes".` +```js +I am a "double quoted" string inside "double quotes". +``` # --hints-- diff --git a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/basic-javascript/shopping-list.md b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/basic-javascript/shopping-list.md index f41435ee2e..5ad68ad924 100644 --- a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/basic-javascript/shopping-list.md +++ b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/basic-javascript/shopping-list.md @@ -13,7 +13,9 @@ Crea una lista de compras en la variable `myList`. La lista debe ser un arreglo El primer elemento de cada sub-arreglo debe contener una cadena con el nombre del artículo. El segundo elemento debe ser un número que represente la cantidad, por ejemplo. -`["Chocolate Bar", 15]` +```js +["Chocolate Bar", 15] +``` Debe haber al menos 5 sub-arreglos en la lista. 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 4d604776cb..48dc4c4abc 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 @@ -13,7 +13,9 @@ Con las variables de arreglos (`array`) de JavaScript, podemos almacenar varios 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"]` +```js +var sandwich = ["peanut butter", "jelly", "bread"] +``` # --instructions-- 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 7e57470e80..38e4883b7f 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 @@ -11,7 +11,9 @@ dashedName: storing-values-with-the-assignment-operator En JavaScript, puedes almacenar un valor en una variable con el operador de asignación (`=`). -`myVariable = 5;` +```js +myVariable = 5; +``` Esto asigna el valor numérico (`Number`) `5` a `myVariable`. diff --git a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/basic-javascript/use-the-parseint-function-with-a-radix.md b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/basic-javascript/use-the-parseint-function-with-a-radix.md index b8b5bf9ca0..aa0a75306c 100644 --- a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/basic-javascript/use-the-parseint-function-with-a-radix.md +++ b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/basic-javascript/use-the-parseint-function-with-a-radix.md @@ -13,17 +13,21 @@ La función `parseInt()` analiza una cadena y devuelve un entero. Recibe un segu La llamada a la función se realiza de la siguiente manera: -`parseInt(string, radix);` +```js +parseInt(string, radix); +``` -A continuación, te presentamos un ejemplo: +Y aquí hay un ejemplo: -`var a = parseInt("11", 2);` +```js +var a = parseInt("11", 2); +``` La variable radix indica que `11` está en el sistema binario, o base 2. Este ejemplo convierte la cadena `11` a un entero `3`. # --instructions-- -Utiliza `parseInt()` dentro de la función `convertToInteger` para convertir un número binario en un número entero, y devuélvelo. +Utiliza `parseInt()` en la función `convertToInteger` para convertir un número binario en un número entero, y devolverlo. # --hints-- diff --git a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/basic-javascript/use-the-parseint-function.md b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/basic-javascript/use-the-parseint-function.md index 5ae97e5377..4f1936b480 100644 --- a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/basic-javascript/use-the-parseint-function.md +++ b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/basic-javascript/use-the-parseint-function.md @@ -11,7 +11,9 @@ dashedName: use-the-parseint-function La función `parseInt()` analiza una cadena y devuelve un entero. A continuación, te presentamos un ejemplo: -`var a = parseInt("007");` +```js +var a = parseInt("007"); +``` La función anterior convierte la cadena `007` al entero `7`. Si el primer carácter de la cadena no puede ser convertido en un número, entonces devuelve `NaN`. diff --git a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/object-oriented-programming/extend-constructors-to-receive-arguments.md b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/object-oriented-programming/extend-constructors-to-receive-arguments.md index 99a679937a..4b7629976d 100644 --- a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/object-oriented-programming/extend-constructors-to-receive-arguments.md +++ b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/object-oriented-programming/extend-constructors-to-receive-arguments.md @@ -1,6 +1,6 @@ --- id: 587d7dae367417b2b2512b79 -title: Extend Constructors to Receive Arguments +title: Extender constructores para recibir argumentos challengeType: 1 forumTopicId: 18235 dashedName: extend-constructors-to-receive-arguments @@ -8,7 +8,7 @@ dashedName: extend-constructors-to-receive-arguments # --description-- -The `Bird` and `Dog` constructors from last challenge worked well. However, notice that all `Birds` that are created with the `Bird` constructor are automatically named Albert, are blue in color, and have two legs. What if you want birds with different values for name and color? It's possible to change the properties of each bird manually but that would be a lot of work: +Los constructores de `Bird` y `Dog` del último desafío funcionaron bien. Sin embargo, nota que todas las `Birds` que son creadas con el constructor `Bird`, automáticamente se nombran Albert, son de color azul y tienen dos patas. ¿Qué pasa si quieres Birds (aves) con diferentes valores para nombre y color? Es posible cambiar manualmente las propiedades de cada Bird (ave), pero sería bastante trabajo: ```js let swan = new Bird(); @@ -16,7 +16,7 @@ swan.name = "Carlos"; swan.color = "white"; ``` -Suppose you were writing a program to keep track of hundreds or even thousands of different birds in an aviary. It would take a lot of time to create all the birds, then change the properties to different values for every one. To more easily create different `Bird` objects, you can design your Bird constructor to accept parameters: +Supongamos que estabas escribiendo un programa para hacer seguimiento de cientos o incluso miles de aves diferentes en un aviario. Tardaría mucho tiempo en crear todas las aves, para luego cambiar las propiedades a diferentes valores para cada una. Para crear más fácilmente diferentes objetos `Bird`, puedes diseñar tu constructor de aves para aceptar parámetros: ```js function Bird(name, color) { @@ -26,41 +26,41 @@ function Bird(name, color) { } ``` -Then pass in the values as arguments to define each unique bird into the `Bird` constructor: `let cardinal = new Bird("Bruce", "red");` This gives a new instance of `Bird` with name and color properties set to Bruce and red, respectively. The `numLegs` property is still set to 2. The `cardinal` has these properties: +Luego pasa los valores como argumentos para definir cada ave única en el constructor `Bird`: `let cardinal = new Bird("Bruce", "red");` Esto genera una nueva instancia de `Bird` con propiedades `name` y `color` que tienen como valor `Bruce` y `red`, respectivamente. La propiedad `numLegs` aún está establecida en 2. El `cardinal` tiene estas propiedades: ```js -cardinal.name // => Bruce -cardinal.color // => red -cardinal.numLegs // => 2 +cardinal.name +cardinal.color +cardinal.numLegs ``` -The constructor is more flexible. It's now possible to define the properties for each `Bird` at the time it is created, which is one way that JavaScript constructors are so useful. They group objects together based on shared characteristics and behavior and define a blueprint that automates their creation. +El constructor es más flexible. Ahora es posible definir las propiedades para cada `Bird` en el momento que se crea. Esta es una manera en que los constructores de JavaScript son tan útiles. Estos agrupan objetos basados en características y comportamiento compartidos, y definen un plano que automatiza su creación. # --instructions-- -Create another `Dog` constructor. This time, set it up to take the parameters `name` and `color`, and have the property `numLegs` fixed at 4. Then create a new `Dog` saved in a variable `terrier`. Pass it two strings as arguments for the `name` and `color` properties. +Crea otro constructor `Dog`. Esta vez, configúralo para tomar los parámetros `name` y `color`, y haz que la propiedad `numLegs` quede fija en 4. Luego crea un nuevo `Dog` almacenado en una variable `terrier`. Pasale dos cadenas de texto como argumentos para las propiedades `name` y `color`. # --hints-- -`Dog` should receive an argument for `name`. +`Dog` debe recibir un argumento para `name`. ```js assert(new Dog('Clifford').name === 'Clifford'); ``` -`Dog` should receive an argument for `color`. +`Dog` debe recibir un argumento para `color`. ```js assert(new Dog('Clifford', 'yellow').color === 'yellow'); ``` -`Dog` should have property `numLegs` set to 4. +`Dog` debe tener la propiedad `numLegs` fija a 4. ```js assert(new Dog('Clifford').numLegs === 4); ``` -`terrier` should be created using the `Dog` constructor. +`terrier` debería ser creado usando el constructor `Dog`. ```js assert(terrier instanceof Dog); diff --git a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/object-oriented-programming/inherit-behaviors-from-a-supertype.md b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/object-oriented-programming/inherit-behaviors-from-a-supertype.md index 357fdeab57..67ed29ab68 100644 --- a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/object-oriented-programming/inherit-behaviors-from-a-supertype.md +++ b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/object-oriented-programming/inherit-behaviors-from-a-supertype.md @@ -1,6 +1,6 @@ --- id: 587d7db0367417b2b2512b84 -title: Inherit Behaviors from a Supertype +title: Hereda comportamientos de un supertipo (supertype) challengeType: 1 forumTopicId: 301319 dashedName: inherit-behaviors-from-a-supertype @@ -8,7 +8,7 @@ dashedName: inherit-behaviors-from-a-supertype # --description-- -In the previous challenge, you created a `supertype` called `Animal` that defined behaviors shared by all animals: +En el desafío anterior, creaste un `supertype` llamado `Animal` que definía comportamientos compartidos por todos los animales: ```js function Animal() { } @@ -17,44 +17,46 @@ Animal.prototype.eat = function() { }; ``` -This and the next challenge will cover how to reuse `Animal's` methods inside `Bird` and `Dog` without defining them again. It uses a technique called inheritance. This challenge covers the first step: make an instance of the `supertype` (or parent). You already know one way to create an instance of `Animal` using the `new` operator: +Este desafío y el siguiente cubrirán como reutilizar los métodos de `Animal's` dentro de `Bird` y `Dog` sin tener que definirlos otra vez. Se utiliza una técnica llamada herencia. Este desafío cubre el primer paso: crear una instancia del `supertype` (o objecto padre). Ya conoces una forma de crear una instancia de `Animal` utilizando el operador `new`: ```js let animal = new Animal(); ``` -There are some disadvantages when using this syntax for inheritance, which are too complex for the scope of this challenge. Instead, here's an alternative approach without those disadvantages: +Hay algunas desventajas cuando se utiliza esta sintaxis para la herencia, pero son demasiado complejas para el alcance de este desafío. En su lugar, hay un enfoque alternativo que no tiene esas desventajas: ```js let animal = Object.create(Animal.prototype); ``` -`Object.create(obj)` creates a new object, and sets `obj` as the new object's `prototype`. Recall that the `prototype` is like the "recipe" for creating an object. By setting the `prototype` of `animal` to be `Animal's` `prototype`, you are effectively giving the `animal` instance the same "recipe" as any other instance of `Animal`. +`Object.create(obj)` crea un objeto nuevo y establece `obj` como el `prototype` del nuevo objeto. Recuerda que `prototype` es como la "receta" para crear un objecto. Al establecer el `prototype` de `animal` como el `prototype` de `Animal's`, estás dándole a la instancia `animal` la misma “receta" que a cualquier otra instancia de `Animal`. ```js -animal.eat(); // prints "nom nom nom" -animal instanceof Animal; // => true +animal.eat(); +animal instanceof Animal; ``` +Aquí el método `instanceof` devolvería `true`. + # --instructions-- -Use `Object.create` to make two instances of `Animal` named `duck` and `beagle`. +Utiliza `Object.create` para crear dos instancias de `Animal` llamadas `duck` y `beagle`. # --hints-- -The `duck` variable should be defined. +La variable `duck` debe estar definida. ```js assert(typeof duck !== 'undefined'); ``` -The `beagle` variable should be defined. +La variable `beagle` debe estar definida. ```js assert(typeof beagle !== 'undefined'); ``` -The `duck` variable should be initialised with `Object.create`. +La variable `duck` debe inicializarse con `Object.create`. ```js assert( @@ -64,7 +66,7 @@ assert( ); ``` -The `beagle` variable should be initialised with `Object.create`. +La variable `beagle` debe inicializarse con `Object.create`. ```js assert( @@ -74,13 +76,13 @@ assert( ); ``` -`duck` should have a `prototype` of `Animal`. +`duck` debe tener un `prototype` de `Animal`. ```js assert(duck instanceof Animal); ``` -`beagle` should have a `prototype` of `Animal`. +`beagle` debe tener un `prototype` de `Animal`. ```js assert(beagle instanceof Animal); diff --git a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/object-oriented-programming/iterate-over-all-properties.md b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/object-oriented-programming/iterate-over-all-properties.md index bc6aa77d26..ef8707dd69 100644 --- a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/object-oriented-programming/iterate-over-all-properties.md +++ b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/object-oriented-programming/iterate-over-all-properties.md @@ -1,6 +1,6 @@ --- id: 587d7daf367417b2b2512b7d -title: Iterate Over All Properties +title: Itera sobre todas las propiedades challengeType: 1 forumTopicId: 301320 dashedName: iterate-over-all-properties @@ -8,7 +8,7 @@ dashedName: iterate-over-all-properties # --description-- -You have now seen two kinds of properties: `own` properties and `prototype` properties. `Own` properties are defined directly on the object instance itself. And `prototype` properties are defined on the `prototype`. +Ahora has visto dos tipos de propiedades: `own` y `prototype`. Las propiedades `own` se definen directamente en la propia instancia del objeto. Y las propiedades `prototype` se definen en el `prototype`. ```js function Bird(name) { @@ -20,7 +20,7 @@ Bird.prototype.numLegs = 2; // prototype property let duck = new Bird("Donald"); ``` -Here is how you add `duck`'s `own` properties to the array `ownProps` and `prototype` properties to the array `prototypeProps`: +A continuación, se explica cómo se agregan las propiedades `own` de `duck` al arreglo `ownProps` y las propiedades `prototype` al arreglo `prototypeProps`: ```js let ownProps = []; @@ -34,29 +34,31 @@ for (let property in duck) { } } -console.log(ownProps); // prints ["name"] -console.log(prototypeProps); // prints ["numLegs"] +console.log(ownProps); +console.log(prototypeProps); ``` +`console.log(ownProps)` debe mostrar `["name"]` en la consola, y `console.log(prototypeProps)` debe mostrar `["numLegs"]`. + # --instructions-- -Add all of the `own` properties of `beagle` to the array `ownProps`. Add all of the `prototype` properties of `Dog` to the array `prototypeProps`. +Agrega todas las propiedades `own` de `beagle` al arreglo `ownProps`. Agrega todas las propiedades `prototype` de `Dog` al arreglo `prototypeProps`. # --hints-- -The `ownProps` array should only contain `"name"`. +El arreglo `ownProps` debe contener solo `name`. ```js assert.deepEqual(ownProps, ['name']); ``` -The `prototypeProps` array should only contain `"numLegs"`. +El arreglo `prototypeProps` debe contener solo `numLegs`. ```js assert.deepEqual(prototypeProps, ['numLegs']); ``` -You should solve this challenge without using the built in method `Object.keys()`. +Debes resolver este desafío sin usar el método incorporado `Object.keys()`. ```js assert(!/\Object.keys/.test(code)); diff --git a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/object-oriented-programming/override-inherited-methods.md b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/object-oriented-programming/override-inherited-methods.md index 24ee9ad513..e6348cda01 100644 --- a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/object-oriented-programming/override-inherited-methods.md +++ b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/object-oriented-programming/override-inherited-methods.md @@ -1,6 +1,6 @@ --- id: 587d7db1367417b2b2512b88 -title: Override Inherited Methods +title: Sobrescribir métodos heredados challengeType: 1 forumTopicId: 301322 dashedName: override-inherited-methods @@ -8,19 +8,19 @@ dashedName: override-inherited-methods # --description-- -In previous lessons, you learned that an object can inherit its behavior (methods) from another object by referencing its `prototype` object: +En lecciones anteriores, aprendiste que un objeto puede heredar su comportamiento (métodos) de otro objeto al referenciar su `prototype`: ```js ChildObject.prototype = Object.create(ParentObject.prototype); ``` -Then the `ChildObject` received its own methods by chaining them onto its `prototype`: +Luego, el `ChildObject` recibió sus propios métodos al encadenarlos a su `prototype`: ```js ChildObject.prototype.methodName = function() {...}; ``` -It's possible to override an inherited method. It's done the same way - by adding a method to `ChildObject.prototype` using the same method name as the one to override. Here's an example of `Bird` overriding the `eat()` method inherited from `Animal`: +Es posible sobreescribir un método heredado. Se hace de la misma manera: agregando un método a `ChildObject.prototype` usando el mismo nombre de método que el que se va a sobrescribir. Aquí hay un ejemplo de `Bird` sobrescribiendo el método `eat()` heredado de `Animal`: ```js function Animal() { } @@ -29,35 +29,33 @@ Animal.prototype.eat = function() { }; function Bird() { } -// Inherit all methods from Animal Bird.prototype = Object.create(Animal.prototype); -// Bird.eat() overrides Animal.eat() Bird.prototype.eat = function() { return "peck peck peck"; }; ``` -If you have an instance `let duck = new Bird();` and you call `duck.eat()`, this is how JavaScript looks for the method on `duck’s` `prototype` chain: +Si tienes una instancia de `let duck = new Bird();` y llamas a `duck.eat()`, de esta manera es como JavaScript busca el método en la cadena de `duck’s` `prototype`: -1. duck => Is eat() defined here? No. -2. Bird => Is eat() defined here? => Yes. Execute it and stop searching. -3. Animal => eat() is also defined, but JavaScript stopped searching before reaching this level. -4. Object => JavaScript stopped searching before reaching this level. +1. `duck` => ¿Está `eat()` definido aquí? No. +2. `Bird` => ¿Está `eat()` definido aquí? => Sí. Ejecutala y detén la búsqueda. +3. `Animal` => `eat()` también está definido, pero JavaScript dejó de buscar antes de llegar a este nivel. +4. Object => JavaScript dejó de buscar antes de llegar a este nivel. # --instructions-- -Override the `fly()` method for `Penguin` so that it returns "Alas, this is a flightless bird." +Sobrescribe el método `fly()` para `Penguin` de manera que devuelva la cadena de texto `Alas, this is a flightless bird.` # --hints-- -`penguin.fly()` should return the string "Alas, this is a flightless bird." +`penguin.fly()` debe devolver la cadena de texto `Alas, this is a flightless bird.` ```js assert(penguin.fly() === 'Alas, this is a flightless bird.'); ``` -The `bird.fly()` method should return "I am flying!" +El método `bird.fly()` debe devolver la cadena de texto `I am flying!` ```js assert(new Bird().fly() === 'I am flying!'); diff --git a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/object-oriented-programming/reset-an-inherited-constructor-property.md b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/object-oriented-programming/reset-an-inherited-constructor-property.md index ce051f75a2..90d2765a0c 100644 --- a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/object-oriented-programming/reset-an-inherited-constructor-property.md +++ b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/object-oriented-programming/reset-an-inherited-constructor-property.md @@ -1,6 +1,6 @@ --- id: 587d7db1367417b2b2512b86 -title: Reset an Inherited Constructor Property +title: Restablece una propiedad constructor heredada challengeType: 1 forumTopicId: 301324 dashedName: reset-an-inherited-constructor-property @@ -8,49 +8,49 @@ dashedName: reset-an-inherited-constructor-property # --description-- -When an object inherits its `prototype` from another object, it also inherits the supertype's constructor property. +Cuando un objeto hereda el `prototype` de otro objeto, también hereda la propiedad del constructor del supertipo. -Here's an example: +Por ejemplo: ```js function Bird() { } Bird.prototype = Object.create(Animal.prototype); let duck = new Bird(); -duck.constructor // function Animal(){...} +duck.constructor ``` -But `duck` and all instances of `Bird` should show that they were constructed by `Bird` and not `Animal`. To do so, you can manually set `Bird's` constructor property to the `Bird` object: +Pero `duck` y todas las instancias de `Bird` deberían mostrar que fueron construidas por `Bird` y no `Animal`. Para hacer esto, puedes establecer de forma manual la propiedad constructor `Bird's` al objeto `Bird`: ```js Bird.prototype.constructor = Bird; -duck.constructor // function Bird(){...} +duck.constructor ``` # --instructions-- -Fix the code so `duck.constructor` and `beagle.constructor` return their respective constructors. +Corrige el código para que `duck.constructor` y `beagle.constructor` devuelvan sus constructores respectivos. # --hints-- -`Bird.prototype` should be an instance of `Animal`. +`Bird.prototype` debe ser una instancia de `Animal`. ```js assert(Animal.prototype.isPrototypeOf(Bird.prototype)); ``` -`duck.constructor` should return `Bird`. +`duck.constructor` debe devolver `Bird`. ```js assert(duck.constructor === Bird); ``` -`Dog.prototype` should be an instance of `Animal`. +`Dog.prototype` debe ser una instancia de `Animal`. ```js assert(Animal.prototype.isPrototypeOf(Dog.prototype)); ``` -`beagle.constructor` should return `Dog`. +`beagle.constructor` debe devolver `Dog`. ```js assert(beagle.constructor === Dog); diff --git a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/regular-expressions/match-anything-with-wildcard-period.md b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/regular-expressions/match-anything-with-wildcard-period.md index 64c17e62a6..332dcc0ef8 100644 --- a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/regular-expressions/match-anything-with-wildcard-period.md +++ b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/regular-expressions/match-anything-with-wildcard-period.md @@ -1,6 +1,6 @@ --- id: 587d7db5367417b2b2512b94 -title: Match Anything with Wildcard Period +title: Haz coincidir cualquier cosa con el comodín punto challengeType: 1 forumTopicId: 301348 dashedName: match-anything-with-wildcard-period @@ -8,72 +8,74 @@ dashedName: match-anything-with-wildcard-period # --description-- -Sometimes you won't (or don't need to) know the exact characters in your patterns. Thinking of all words that match, say, a misspelling would take a long time. Luckily, you can save time using the wildcard character: `.` +A veces no conoces (o no necesitas conocer) los caracteres exactos en tus patrones. Pensar en todas las palabras que coincidan, digamos, con una ortografía errónea llevaría mucho tiempo. Afortunadamente, puedes ahorrar tiempo utilizando el carácter de comodín: `.` -The wildcard character `.` will match any one character. The wildcard is also called `dot` and `period`. You can use the wildcard character just like any other character in the regex. For example, if you wanted to match `"hug"`, `"huh"`, `"hut"`, and `"hum"`, you can use the regex `/hu./` to match all four words. +El carácter de comodín `.` coincidirá con cualquier carácter único. El comodín también es llamado `dot` y `period`. Puedes utilizar el carácter de comodín como cualquier otro carácter en la expresión regular. Por ejemplo, si quieres hacer coincidir `hug`, `huh`, `hut`, y `hum`, puedes usar la la expresión regular `/hu./` para que coincida con las cuatro palabras. ```js let humStr = "I'll hum a song"; let hugStr = "Bear hug"; let huRegex = /hu./; -huRegex.test(humStr); // Returns true -huRegex.test(hugStr); // Returns true +huRegex.test(humStr); +huRegex.test(hugStr); ``` +Ambas llamadas a `test` devolverán `true`. + # --instructions-- -Complete the regex `unRegex` so that it matches the strings `"run"`, `"sun"`, `"fun"`, `"pun"`, `"nun"`, and `"bun"`. Your regex should use the wildcard character. +Completa la expresión regular `unRegex` para que coincida con las cadenas `run`, `sun`, `fun`, `pun`, `nun`, y `bun`. Tu expresión regular debe usar el carácter de comodín. # --hints-- -You should use the `.test()` method. +Debes usar el método `.test()`. ```js assert(code.match(/\.test\(.*\)/)); ``` -You should use the wildcard character in your regex `unRegex` +Debes usar el carácter de comodín en tu expresión regular `unRegex` ```js assert(/\./.test(unRegex.source)); ``` -Your regex `unRegex` should match `"run"` in `"Let us go on a run."` +Tu expresión regular `unRegex` debe coincidir con `run` en la cadena `Let us go on a run.` ```js unRegex.lastIndex = 0; assert(unRegex.test('Let us go on a run.')); ``` -Your regex `unRegex` should match `"sun"` in `"The sun is out today."` +Tu expresión regular `unRegex` debe coincidir con `sun` en la cadena `The sun is out today.` ```js unRegex.lastIndex = 0; assert(unRegex.test('The sun is out today.')); ``` -Your regex `unRegex` should match `"fun"` in `"Coding is a lot of fun."` +Tu expresión regular `unRegex` debe coincidir con `fun` en la cadena `Coding is a lot of fun.` ```js unRegex.lastIndex = 0; assert(unRegex.test('Coding is a lot of fun.')); ``` -Your regex `unRegex` should match `"pun"` in `"Seven days without a pun makes one weak."` +Tu expresión regular `unRegex` debe coincidir con `pun` en la cadena `Seven days without a pun makes one weak.` ```js unRegex.lastIndex = 0; assert(unRegex.test('Seven days without a pun makes one weak.')); ``` -Your regex `unRegex` should match `"nun"` in `"One takes a vow to be a nun."` +Tu expresión regular `unRegex` debe coincidir con `nun` en la cadena `One takes a vow to be a nun.` ```js unRegex.lastIndex = 0; assert(unRegex.test('One takes a vow to be a nun.')); ``` -Your regex `unRegex` should match `"bun"` in `"She got fired from the hot dog stand for putting her hair in a bun."` +Tu expresión regular `unRegex` debe coincidir con `bun` en la cadena `She got fired from the hot dog stand for putting her hair in a bun.` ```js unRegex.lastIndex = 0; @@ -84,14 +86,14 @@ assert( ); ``` -Your regex `unRegex` should not match `"There is a bug in my code."` +Tu expresión regular `unRegex` no debe coincidir con la cadena `There is a bug in my code.` ```js unRegex.lastIndex = 0; assert(!unRegex.test('There is a bug in my code.')); ``` -Your regex `unRegex` should not match `"Catch me if you can."` +Tu expresión regular `unRegex` no debe coincidir con la cadena `Catch me if you can.` ```js unRegex.lastIndex = 0; diff --git a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/regular-expressions/match-beginning-string-patterns.md b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/regular-expressions/match-beginning-string-patterns.md index 099238eebf..d5ecf38d61 100644 --- a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/regular-expressions/match-beginning-string-patterns.md +++ b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/regular-expressions/match-beginning-string-patterns.md @@ -1,6 +1,6 @@ --- id: 587d7db7367417b2b2512b9d -title: Match Beginning String Patterns +title: Haz coincidir patrones de cadena de inicio challengeType: 1 forumTopicId: 301349 dashedName: match-beginning-string-patterns @@ -8,45 +8,45 @@ dashedName: match-beginning-string-patterns # --description-- -Prior challenges showed that regular expressions can be used to look for a number of matches. They are also used to search for patterns in specific positions in strings. +Los desafíos anteriores demostraron que las expresiones regulares pueden ser utilizadas para buscar una serie de coincidencias. También se utilizan para buscar patrones en posiciones específicas en cadenas. -In an earlier challenge, you used the caret character (`^`) inside a character set to create a negated character set in the form `[^thingsThatWillNotBeMatched]`. Outside of a character set, the caret is used to search for patterns at the beginning of strings. +En un desafío anterior, usaste el carácter caret (`^`) dentro de un conjunto de caracteres para crear un conjunto de caracteres en la forma `[^thingsThatWillNotBeMatched]`. Fuera de un conjunto de caracteres, el caret es utilizado para buscar patrones al principio de las cadenas. ```js let firstString = "Ricky is first and can be found."; let firstRegex = /^Ricky/; firstRegex.test(firstString); -// Returns true let notFirst = "You can't find Ricky now."; firstRegex.test(notFirst); -// Returns false ``` +La primera llamada `test` devolverá `true`, mientras que la segunda retornara `false`. + # --instructions-- -Use the caret character in a regex to find `"Cal"` only in the beginning of the string `rickyAndCal`. +Usa el carácter caret en una expresión para buscar `Cal` solo al principio de la cadena `rickyAndCal`. # --hints-- -Your regex should search for `"Cal"` with a capital letter. +Tu expresión regular debe buscar la cadena `Cal` con una letra mayúscula. ```js assert(calRegex.source == '^Cal'); ``` -Your regex should not use any flags. +Tu expresión regular no debería usar ninguna etiqueta. ```js assert(calRegex.flags == ''); ``` -Your regex should match `"Cal"` at the beginning of the string. +Tu expresión regular debe coincidir con la cadena `Cal` en el inicio de la cadena. ```js assert(calRegex.test('Cal and Ricky both like racing.')); ``` -Your regex should not match `"Cal"` in the middle of a string. +Tu expresión regular debe coincidir con la cadena `Cal` en medio de la cadena. ```js assert(!calRegex.test('Ricky and Cal both like racing.')); diff --git a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/regular-expressions/match-characters-that-occur-one-or-more-times.md b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/regular-expressions/match-characters-that-occur-one-or-more-times.md index cf54e942ff..ec9a1a78b1 100644 --- a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/regular-expressions/match-characters-that-occur-one-or-more-times.md +++ b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/regular-expressions/match-characters-that-occur-one-or-more-times.md @@ -1,6 +1,6 @@ --- id: 587d7db6367417b2b2512b99 -title: Match Characters that Occur One or More Times +title: Haz coincidir caracteres que aparecen una o más veces challengeType: 1 forumTopicId: 301350 dashedName: match-characters-that-occur-one-or-more-times @@ -8,33 +8,33 @@ dashedName: match-characters-that-occur-one-or-more-times # --description-- -Sometimes, you need to match a character (or group of characters) that appears one or more times in a row. This means it occurs at least once, and may be repeated. +A veces, es necesario coincidir con un carácter (o grupo de caracteres) que aparezca una o más veces seguidas. Esto significa que aparece al menos una vez, y puede repetirse. -You can use the `+` character to check if that is the case. Remember, the character or pattern has to be present consecutively. That is, the character has to repeat one after the other. +Puedes usar el carácter `+` para comprobar si es así. Recuerda, el carácter o patrón debe estar presente consecutivamente. Es decir, el carácter tiene que repetirse uno tras otro. -For example, `/a+/g` would find one match in `"abc"` and return `["a"]`. Because of the `+`, it would also find a single match in `"aabc"` and return `["aa"]`. +Por ejemplo, `/a+/g` encontraría una coincidencia en `abc` y regresaría `["a"]`. Debido al `+`, también encontraría una sola coincidencia en `aabc` y regresaría `["aa"]`. -If it were instead checking the string `"abab"`, it would find two matches and return `["a", "a"]` because the `a` characters are not in a row - there is a `b` between them. Finally, since there is no `"a"` in the string `"bcd"`, it wouldn't find a match. +Si en su lugar estuvieras comprobando la cadena `abab`, se encontrarían dos coincidencias y regresaría `["a", "a"]` porque los caracteres `a` no están en fila; hay una `b` entre ellos. Finalmente, dado que no hay una `a` en la cadena `bcd`, no se encontraría una coincidencia. # --instructions-- -You want to find matches when the letter `s` occurs one or more times in `"Mississippi"`. Write a regex that uses the `+` sign. +Quieres encontrar coincidencias cuando la letra `s` ocurre una o más veces en `Mississippi`. Escribe una expresión regular que utilice el signo `+`. # --hints-- -Your regex `myRegex` should use the `+` sign to match one or more `s` characters. +Tu expresión regular `myRegex` debe utilizar el signo `+` para coincidir con uno o más caracteres de `s`. ```js assert(/\+/.test(myRegex.source)); ``` -Your regex `myRegex` should match 2 items. +Tu expresión regular `myRegex` debe coincidir con 2 elementos. ```js assert(result.length == 2); ``` -The `result` variable should be an array with two matches of `"ss"` +La variable `result` debe ser un arreglo con dos coincidencias de `ss` ```js assert(result[0] == 'ss' && result[1] == 'ss'); diff --git a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/regular-expressions/match-characters-that-occur-zero-or-more-times.md b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/regular-expressions/match-characters-that-occur-zero-or-more-times.md index 745202e5fe..5a2a7dc7c7 100644 --- a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/regular-expressions/match-characters-that-occur-zero-or-more-times.md +++ b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/regular-expressions/match-characters-that-occur-zero-or-more-times.md @@ -1,6 +1,6 @@ --- id: 587d7db6367417b2b2512b9a -title: Match Characters that Occur Zero or More Times +title: Haz coincidir caracteres que aparecen cero o más veces challengeType: 1 forumTopicId: 301351 dashedName: match-characters-that-occur-zero-or-more-times @@ -8,51 +8,53 @@ dashedName: match-characters-that-occur-zero-or-more-times # --description-- -The last challenge used the plus `+` sign to look for characters that occur one or more times. There's also an option that matches characters that occur zero or more times. +El último desafío utilizó el signo más `+` para buscar caracteres que aparecen una o más veces. También hay una opción para hacer coincidir caracteres que aparecen cero o más veces. -The character to do this is the asterisk or star: `*`. +El carácter que hace esto es el asterisco o la estrella: `*`. ```js let soccerWord = "gooooooooal!"; let gPhrase = "gut feeling"; let oPhrase = "over the moon"; let goRegex = /go*/; -soccerWord.match(goRegex); // Returns ["goooooooo"] -gPhrase.match(goRegex); // Returns ["g"] -oPhrase.match(goRegex); // Returns null +soccerWord.match(goRegex); +gPhrase.match(goRegex); +oPhrase.match(goRegex); ``` +En orden, los tres `match` devolverán los valores `["goooooooo"]`, `["g"]`, y `null`. + # --instructions-- -For this challenge, `chewieQuote` has been initialized as "Aaaaaaaaaaaaaaaarrrgh!" behind the scenes. Create a regex `chewieRegex` that uses the `*` character to match an uppercase `"A"` character immediately followed by zero or more lowercase `"a"` characters in `chewieQuote`. Your regex does not need flags or character classes, and it should not match any of the other quotes. +Para este desafío, `chewieQuote` ha sido inicializada entre bastidores con la cadena `Aaaaaaaaaaaaaaaarrrgh!`. Crea una expresión regular `chewieRegex` que utilice el carácter `*` para encontrar el carácter `A` mayúscula seguido inmediatamente por cero o más caracteres `a` minúscula en `chewieQuote`. Tu expresión regular no necesita banderas o clases de caracteres, y no debe coincidir con ninguna de las otras comillas. # --hints-- -Your regex `chewieRegex` should use the `*` character to match zero or more `a` characters. +Tu expresión regular `chewieRegex` debe utilizar el `*` para que coincida con cero o más caracteres `a`. ```js assert(/\*/.test(chewieRegex.source)); ``` -Your regex should match `"A"` in `chewieQuote`. +Tu expresión regular debe coincidir con la cadena `A` en `chewieQuote`. ```js assert(result[0][0] === 'A'); ``` -Your regex should match `"Aaaaaaaaaaaaaaaa"` in `chewieQuote`. +Tu expresión regular debe coincidir con la cadena `Aaaaaaaaaaaaaaaa` en `chewieQuote`. ```js assert(result[0] === 'Aaaaaaaaaaaaaaaa'); ``` -Your regex `chewieRegex` should match 16 characters in `chewieQuote`. +Tu expresión regular `chewieRegex` debe coincidir con 16 caracteres en `chewieQuote`. ```js assert(result[0].length === 16); ``` -Your regex should not match any characters in "He made a fair move. Screaming about it can't help you." +Tu expresión regular no debe coincidir con ningún carácter con la cadena `He made a fair move. Screaming about it can't help you.` ```js assert( @@ -60,7 +62,7 @@ assert( ); ``` -Your regex should not match any characters in "Let him have it. It's not wise to upset a Wookiee." +Tu expresión regular no debe coincidir con ningún carácter con la cadena `Let him have it. It's not wise to upset a Wookiee.` ```js assert( diff --git a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/regular-expressions/match-ending-string-patterns.md b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/regular-expressions/match-ending-string-patterns.md index 60e1638ce7..1a4964183a 100644 --- a/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/regular-expressions/match-ending-string-patterns.md +++ b/curriculum/challenges/espanol/02-javascript-algorithms-and-data-structures/regular-expressions/match-ending-string-patterns.md @@ -1,6 +1,6 @@ --- id: 587d7db7367417b2b2512b9e -title: Match Ending String Patterns +title: Haz coincidir patrones de cadena final challengeType: 1 forumTopicId: 301352 dashedName: match-ending-string-patterns @@ -8,40 +8,39 @@ dashedName: match-ending-string-patterns # --description-- -In the last challenge, you learned to use the caret character to search for patterns at the beginning of strings. There is also a way to search for patterns at the end of strings. +En el último desafío, aprendiste a usar el carácter de intercalación para buscar patrones al inicio de las cadenas. También hay una manera de buscar patrones al final de las cadenas. -You can search the end of strings using the dollar sign character `$` at the end of the regex. +Puedes buscar el final de las cadenas usando el carácter del signo de dólar `$` al final de la expresión regular. ```js let theEnding = "This is a never ending story"; let storyRegex = /story$/; storyRegex.test(theEnding); -// Returns true let noEnding = "Sometimes a story will have to end"; storyRegex.test(noEnding); -// Returns false - ``` +La primera llamada a `test` devuelve `true`, mientras que la segunda retorna `false`. + # --instructions-- -Use the anchor character (`$`) to match the string `"caboose"` at the end of the string `caboose`. +Usa el carácter de ancla (`$`) para coincidir la cadena `caboose` al final de la cadena `caboose`. # --hints-- -You should search for `"caboose"` with the dollar sign `$` anchor in your regex. +Debes buscar `caboose` con el ancla de signo de dólar `$` en tu expresión regular. ```js assert(lastRegex.source == 'caboose$'); ``` -Your regex should not use any flags. +Tu expresión regular no debe usar ninguna bandera. ```js assert(lastRegex.flags == ''); ``` -You should match `"caboose"` at the end of the string `"The last car on a train is the caboose"` +Debes coincidir `caboose` al final de la cadena `The last car on a train is the caboose` ```js assert(lastRegex.test('The last car on a train is the caboose'));