chore(i8n,learn): processed translations (#41350)
* chore(i8n,learn): processed translations * fix: restore deleted test * fix: revert casing change Co-authored-by: Crowdin Bot <support+bot@crowdin.com>
This commit is contained in:
committed by
GitHub
parent
8e4ada8f2d
commit
aff0ea700d
@ -1,6 +1,6 @@
|
||||
---
|
||||
id: 587d7b7c367417b2b2512b1a
|
||||
title: Access Property Names with Bracket Notation
|
||||
title: Accede a los nombres de propiedad con la notación de corchetes
|
||||
challengeType: 1
|
||||
forumTopicId: 301150
|
||||
dashedName: access-property-names-with-bracket-notation
|
||||
@ -8,28 +8,28 @@ dashedName: access-property-names-with-bracket-notation
|
||||
|
||||
# --description--
|
||||
|
||||
In the first object challenge we mentioned the use of bracket notation as a way to access property values using the evaluation of a variable. For instance, imagine that our `foods` object is being used in a program for a supermarket cash register. We have some function that sets the `selectedFood` and we want to check our `foods` object for the presence of that food. This might look like:
|
||||
En el primer desafío de objetos mencionamos el uso de notación de corchetes como una manera de acceder a los valores de una propiedad mediante la evaluación de una variable. Por ejemplo, imagina que nuestro objeto `foods` está siendo usado en un programa para una caja registradora de supermercado. Tenemos una función que establece `selectedFood` y queremos revisar en nuestro objeto `foods` si ese alimento está presente. Esto podría verse así:
|
||||
|
||||
```js
|
||||
let selectedFood = getCurrentFood(scannedItem);
|
||||
let inventory = foods[selectedFood];
|
||||
```
|
||||
|
||||
This code will evaluate the value stored in the `selectedFood` variable and return the value of that key in the `foods` object, or `undefined` if it is not present. Bracket notation is very useful because sometimes object properties are not known before runtime or we need to access them in a more dynamic way.
|
||||
El código evaluará el valor almacenado en la variable `selectedFood` y devolverá el valor de esa clave en el objeto `foods`, o `undefined` si no está presente. La notación de corchetes es muy útil porque a veces no conocemos las propiedades de los objetos antes de la ejecución o necesitamos acceder a ellos de una manera más dinámica.
|
||||
|
||||
# --instructions--
|
||||
|
||||
We've defined a function, `checkInventory`, which receives a scanned item as an argument. Return the current value of the `scannedItem` key in the `foods` object. You can assume that only valid keys will be provided as an argument to `checkInventory`.
|
||||
Hemos definido una función, `checkInventory`, que recibe como argumento un elemento escaneado. Devuelve el valor actual de la clave `scannedItem` en el objeto `foods`. Puedes asumir que sólo se proporcionarán claves válidas como argumento a `checkInventory`.
|
||||
|
||||
# --hints--
|
||||
|
||||
`checkInventory` should be a function.
|
||||
`checkInventory` debe ser una función.
|
||||
|
||||
```js
|
||||
assert.strictEqual(typeof checkInventory, 'function');
|
||||
```
|
||||
|
||||
The `foods` object should have only the following key-value pairs: `apples: 25`, `oranges: 32`, `plums: 28`, `bananas: 13`, `grapes: 35`, `strawberries: 27`.
|
||||
El objeto `foods` debe tener solo los siguientes pares clave-valor: `apples: 25`, `oranges: 32`, `plums: 28`, `bananas: 13`, `grapes: 35`, `strawberries: 27`.
|
||||
|
||||
```js
|
||||
assert.deepEqual(foods, {
|
||||
@ -42,19 +42,19 @@ assert.deepEqual(foods, {
|
||||
});
|
||||
```
|
||||
|
||||
`checkInventory("apples")` should return `25`.
|
||||
`checkInventory("apples")` debe devolver `25`.
|
||||
|
||||
```js
|
||||
assert.strictEqual(checkInventory('apples'), 25);
|
||||
```
|
||||
|
||||
`checkInventory("bananas")` should return `13`.
|
||||
`checkInventory("bananas")` debe devolver `13`.
|
||||
|
||||
```js
|
||||
assert.strictEqual(checkInventory('bananas'), 13);
|
||||
```
|
||||
|
||||
`checkInventory("strawberries")` should return `27`.
|
||||
`checkInventory("strawberries")` debe devolver `27`.
|
||||
|
||||
```js
|
||||
assert.strictEqual(checkInventory('strawberries'), 27);
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
id: 587d7b7d367417b2b2512b1e
|
||||
title: Generar un arreglo de todas las claves de los objetos con Object.keys()
|
||||
title: Genera un arreglo de todas las claves de los objetos con Object.keys()
|
||||
challengeType: 1
|
||||
forumTopicId: 301160
|
||||
dashedName: generate-an-array-of-all-object-keys-with-object-keys
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
id: 587d7b7d367417b2b2512b1f
|
||||
title: Modificar un arreglo almacenado en un objeto
|
||||
title: Modifica un arreglo almacenado en un objeto
|
||||
challengeType: 1
|
||||
forumTopicId: 301163
|
||||
dashedName: modify-an-array-stored-in-an-object
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
id: 587d7b7c367417b2b2512b19
|
||||
title: Modify an Object Nested Within an Object
|
||||
title: Modifica un objeto anidado dentro de un objeto
|
||||
challengeType: 1
|
||||
forumTopicId: 301164
|
||||
dashedName: modify-an-object-nested-within-an-object
|
||||
@ -8,7 +8,7 @@ dashedName: modify-an-object-nested-within-an-object
|
||||
|
||||
# --description--
|
||||
|
||||
Now let's take a look at a slightly more complex object. Object properties can be nested to an arbitrary depth, and their values can be any type of data supported by JavaScript, including arrays and even other objects. Consider the following:
|
||||
Veamos ahora un objeto un poco más complejo. Las propiedades de los objetos pueden anidarse a una profundidad arbitraria, y sus valores pueden ser cualquier tipo de datos soportados por JavaScript, incluyendo arreglos e incluso otros objetos. Considera lo siguiente:
|
||||
|
||||
```js
|
||||
let nestedObject = {
|
||||
@ -26,7 +26,7 @@ let nestedObject = {
|
||||
};
|
||||
```
|
||||
|
||||
`nestedObject` has three properties: `id` (value is a number), `date` (value is a string), and `data` (value is an object with its nested structure). While structures can quickly become complex, we can still use the same notations to access the information we need. To assign the value `10` to the `busy` property of the nested `onlineStatus` object, we use dot notation to reference the property:
|
||||
`nestedObject` tiene tres propiedades: `id` (el valor es un número), `date` (el valor es una cadena), y `data` (el valor es un objeto con su estructura anidada). Aunque las estructuras pueden volverse rápidamente complejas, podemos seguir utilizando las mismas notaciones para acceder a la información que necesitamos. Para asignar el valor `10` a la propiedad `busy` del objeto anidado `onlineStatus`, utilizamos la notación de puntos para referenciar la propiedad:
|
||||
|
||||
```js
|
||||
nestedObject.data.onlineStatus.busy = 10;
|
||||
@ -34,11 +34,11 @@ nestedObject.data.onlineStatus.busy = 10;
|
||||
|
||||
# --instructions--
|
||||
|
||||
Here we've defined an object `userActivity`, which includes another object nested within it. Set the value of the `online` key to `45`.
|
||||
Aquí hemos definido un objeto `userActivity`, que incluye otro objeto anidado dentro de él. Establece el valor de la clave `online` en `45`.
|
||||
|
||||
# --hints--
|
||||
|
||||
`userActivity` should have `id`, `date` and `data` properties.
|
||||
`userActivity` debe tener las propiedades `id`, `date` y `data`.
|
||||
|
||||
```js
|
||||
assert(
|
||||
@ -46,19 +46,19 @@ assert(
|
||||
);
|
||||
```
|
||||
|
||||
`userActivity` should have a `data` key set to an object with keys `totalUsers` and `online`.
|
||||
`userActivity` debe tener una clave `data` establecida en un objeto con las claves `totalUsers` y `online`.
|
||||
|
||||
```js
|
||||
assert('totalUsers' in userActivity.data && 'online' in userActivity.data);
|
||||
```
|
||||
|
||||
The `online` property nested in the `data` key of `userActivity` should be set to `45`
|
||||
La propiedad `online` anidada en la clave `data` de `userActivity` debe establecerse en `45`
|
||||
|
||||
```js
|
||||
assert(userActivity.data.online === 45);
|
||||
```
|
||||
|
||||
The `online` property should be set using dot or bracket notation.
|
||||
La propiedad `online` debe establecerse utilizando la notación de puntos o corchetes.
|
||||
|
||||
```js
|
||||
assert.strictEqual(code.search(/online: 45/), -1);
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
id: 587d7b7c367417b2b2512b1b
|
||||
title: Use the delete Keyword to Remove Object Properties
|
||||
title: Usa la palabra clave "delete" para eliminar las propiedades de los objetos
|
||||
challengeType: 1
|
||||
forumTopicId: 301168
|
||||
dashedName: use-the-delete-keyword-to-remove-object-properties
|
||||
@ -8,11 +8,11 @@ dashedName: use-the-delete-keyword-to-remove-object-properties
|
||||
|
||||
# --description--
|
||||
|
||||
Now you know what objects are and their basic features and advantages. In short, they are key-value stores which provide a flexible, intuitive way to structure data, ***and***, they provide very fast lookup time. Throughout the rest of these challenges, we will describe several common operations you can perform on objects so you can become comfortable applying these useful data structures in your programs.
|
||||
Ahora ya sabes qué son los objetos y sus características y ventajas básicas. En resumen, son almacenes clave-valor que proporcionan una forma flexible e intuitiva de estructurar los datos, ***y***, proporcionan un tiempo de búsqueda muy rápido. A lo largo del resto de estos desafíos, describiremos varias operaciones comúnes que puedes realizar sobre los objetos para que te sientas cómodo aplicando estas útiles estructuras de datos en tus programas.
|
||||
|
||||
In earlier challenges, we have both added to and modified an object's key-value pairs. Here we will see how we can *remove* a key-value pair from an object.
|
||||
En desafíos anteriores, hemos agregado y modificado los pares clave-valor de un objeto. Aquí veremos cómo podemos *eliminar* un par clave-valor de un objeto.
|
||||
|
||||
Let's revisit our `foods` object example one last time. If we wanted to remove the `apples` key, we can remove it by using the `delete` keyword like this:
|
||||
Volvamos a nuestro ejemplo del objeto `foods` una última vez. Si quisiéramos eliminar la clave `apples`, podemos eliminarla utilizando la palabra clave `delete` de esta manera:
|
||||
|
||||
```js
|
||||
delete foods.apples;
|
||||
@ -20,11 +20,11 @@ delete foods.apples;
|
||||
|
||||
# --instructions--
|
||||
|
||||
Use the delete keyword to remove the `oranges`, `plums`, and `strawberries` keys from the `foods` object.
|
||||
Usa la palabra clave delete para eliminar las claves `oranges`, `plums` y `strawberries` del objeto `foods`.
|
||||
|
||||
# --hints--
|
||||
|
||||
The `foods` object should only have three keys: `apples`, `grapes`, and `bananas`.
|
||||
El objeto `foods` sólo debe tener tres claves: `apples`, `grapes` y `bananas`.
|
||||
|
||||
```js
|
||||
assert(
|
||||
@ -35,7 +35,7 @@ assert(
|
||||
);
|
||||
```
|
||||
|
||||
The `oranges`, `plums`, and `strawberries` keys should be removed using `delete`.
|
||||
Las claves `oranges`, `plums` y `strawberries` deben ser eliminadas usando `delete`.
|
||||
|
||||
```js
|
||||
assert(
|
||||
|
Reference in New Issue
Block a user