Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions i18n/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
, "LOOPING THROUGH ARRAYS": "ITÉRER SUR UN TABLEAU"
, "OBJECTS": "OBJETS"
, "OBJECT PROPERTIES": "PROPRIÉTÉS D'OBJETS"
, "OBJECT KEYS": "CLÉS D'OBJETS"
, "FUNCTIONS": "FONCTIONS"
, "FUNCTION ARGUMENTS": "ARGUMENTS DE FONCTIONS"
, "SCOPE": "SCOPE"
Expand Down
17 changes: 8 additions & 9 deletions problems/object-keys/problem_fr.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
JavaScript provides a native way of listing all the available keys of an object. This can be helpful for looping through all the properties of an object and manipulating their values accordingly.
JavaScript fournit un moyen natif de lister toutes les clés disponibles d'un objet. Ceci peut être utile pour parcourir en boucle toutes les propriétés d'un objet et manipuler leurs valeurs en conséquence.

Here's an example of listing all object keys using the **Object.keys()**
prototype method.
Voici un exemple de liste de toutes les clés d'objets utilisant la méthode prototype **Object.keys()**.

```js
const car = {
Expand All @@ -14,13 +13,13 @@ const keys = Object.keys(car)
console.log(keys)
```

The above code will print an array of strings, where each string is a key in the car object. `['make', 'model', 'year']`
Le code ci-dessus imprimera un tableau de _strings_, où chaque _string_ est une _clé_ (_key_) dans l'objet `car`. `['make', 'model', 'year']`

## The challenge:

Create a file named `object-keys.js`.
Créez un fichier nommé `object-keys.js`.

In that file, define a variable named `car` like this:
Dans ce fichier, définissez une variable nommée `car` comme ceci:

```js
const car = {
Expand All @@ -30,14 +29,14 @@ const car = {
}
```

Then define another variable named `keys` like this:
Définissez ensuite une autre variable nommée `keys` comme ceci:
```js
const keys = Object.keys(car)
```

Use `console.log()` to print the `keys` variable to the terminal.
Utilisez `console.log()` pour imprimer la variable `keys` sur le terminal.

Check to see if your program is correct by running this command:
Vérifiez si votre programme est correct en exécutant cette commande:

```bash
javascripting verify object-keys.js
Expand Down
6 changes: 3 additions & 3 deletions problems/object-keys/solution_fr.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

# CORRECT.

Good job using the Object.keys() prototype method. Remember to use it when you need to list the keys of an object.
Bon travail avec la méthode du prototype Object.keys(). N'oubliez pas de l'utiliser lorsque vous devez lister les clés d'un objet.

The next challenge is all about **functions**.
Le prochain défi portera sur les **functions**.

Run `javascripting` in the console to choose the next challenge.
Exécutez `javascripting` dans la console pour choisir le prochain défi.

---