Skip to content

Commit

Permalink
Merge pull request #270 from lupomontero/translate_object_keys_challenge
Browse files Browse the repository at this point in the history
Adds spanish translation for object-keys exercise #267
  • Loading branch information
ledsun authored Sep 3, 2019
2 parents c403678 + abb7ded commit 161ad4b
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 4 deletions.
1 change: 1 addition & 0 deletions i18n/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
, "LOOPING THROUGH ARRAYS": "RECORRIENDO ARRAYS"
, "OBJECTS": "OBJETOS"
, "OBJECT PROPERTIES": "PROPIEDADES DE OBJETOS"
, "OBJECT KEYS": "LLAVES/KEYS DE OBJETOS"
, "FUNCTIONS": "FUNCIONES"
, "FUNCTION ARGUMENTS": "ARGUMENTOS DE FUNCIONES"
, "SCOPE": "CONTEXTO"
Expand Down
49 changes: 46 additions & 3 deletions problems/object-keys/problem_es.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,48 @@
---
JavaScript nos da una manera nativa de listar _todas_ las _llaves_ (_keys_) de
un objeto. Esto puede ser muy útil para iterar sobre las propiedades de un
objeto y manipular sus valores.

#
Veámos un ejemplo de cómo podríamos listar todas las propiedades de un objeto
usando el método **Object.keys()**:

---
```js
const car = {
make: 'Toyota',
model: 'Camry',
year: 2020
};
const keys = Object.keys(car);

console.log(keys);
```

El código de arriba imprime una arreglo de _strings_, donde cada _string_ es una
_llave_ (_key_) en el objeto `car` (`['make', 'model', 'year']`).

## El reto:

Crea un archivo llamado `object-keys.js`.

En ese archivo, define una variable llamada `car`:

```js
const car = {
make: 'Honda',
model: 'Accord',
year: 2020
};
```

Después define otra variable llamada `keys`:

```js
const keys = Object.keys(car);
```

Usa `console.log()` para imprimir la variable `keys` a la consola.

Comprueba si tu programa es correcto ejecutando el siguiente comando:

```bash
javascripting verify object-keys.js
```
8 changes: 7 additions & 1 deletion problems/object-keys/solution_es.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
---

#
# CORRECTO.

Buen trabajo usando el método Object.keys(). Recuerda usarlo cuando necesites listar las propiedades de un objeto.

El próximo ejercicio trabajaremos con **funciones**.

Ejecuta `javascripting` en la consola para seleccionar el siguiente ejercicio.

---

0 comments on commit 161ad4b

Please sign in to comment.