You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: problems/object-keys/problem_fr.md
+8-9Lines changed: 8 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,6 @@
1
-
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.
1
+
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.
2
2
3
-
Here's an example of listing all object keys using the **Object.keys()**
4
-
prototype method.
3
+
Voici un exemple de liste de toutes les clés d'objets utilisant la méthode prototype **Object.keys()**.
5
4
6
5
```js
7
6
constcar= {
@@ -14,13 +13,13 @@ const keys = Object.keys(car)
14
13
console.log(keys)
15
14
```
16
15
17
-
The above code will print an array of strings, where each string is a key in the car object. `['make', 'model', 'year']`
16
+
Le code ci-dessus imprimera un tableau de _strings_, où chaque _string_ est une _clé_ (_key_) dans l'objet `car`. `['make', 'model', 'year']`
18
17
19
18
## The challenge:
20
19
21
-
Create a file named`object-keys.js`.
20
+
Créez un fichier nommé`object-keys.js`.
22
21
23
-
In that file, define a variable named`car`like this:
22
+
Dans ce fichier, définissez une variable nommée`car`comme ceci:
24
23
25
24
```js
26
25
constcar= {
@@ -30,14 +29,14 @@ const car = {
30
29
}
31
30
```
32
31
33
-
Then define another variable named`keys`like this:
32
+
Définissez ensuite une autre variable nommée`keys`comme ceci:
34
33
```js
35
34
constkeys=Object.keys(car)
36
35
```
37
36
38
-
Use`console.log()`to print the `keys`variable to the terminal.
37
+
Utilisez`console.log()`pour imprimer la variable `keys`sur le terminal.
39
38
40
-
Check to see if your program is correct by running this command:
39
+
Vérifiez si votre programme est correct en exécutant cette commande:
0 commit comments