File tree Expand file tree Collapse file tree 3 files changed +118
-118
lines changed
1-js/05-data-types/09-destructuring-assignment Expand file tree Collapse file tree 3 files changed +118
-118
lines changed Original file line number Diff line number Diff line change @@ -2,9 +2,9 @@ importance: 5
2
2
3
3
---
4
4
5
- # Destructuring assignment
5
+ # L'affectation par décomposition
6
6
7
- We have an object :
7
+ Nous avons un objet :
8
8
9
9
``` js
10
10
let user = {
@@ -13,18 +13,18 @@ let user = {
13
13
};
14
14
```
15
15
16
- Write the destructuring assignment that reads :
16
+ Écrivez l'affectation par décomposition qui se lit comme suit :
17
17
18
- - ` name ` property into the variable ` name ` .
19
- - ` years ` property into the variable ` age ` .
20
- - ` isAdmin ` property into the variable ` isAdmin ` (false if absent)
18
+ - Propriété ` name ` dans la variable ` name ` .
19
+ - Propriété ` years ` dans la variable ` age ` .
20
+ - Proprété ` isAdmin ` dans la variable ` isAdmin ` (false si absent)
21
21
22
- The values after the assignment should be :
22
+ Les valeurs après l'affectation doivent être :
23
23
24
24
``` js
25
25
let user = { name: " John" , years: 30 };
26
26
27
- // your code to the left side :
27
+ // votre code à gauche : :
28
28
// ... = user
29
29
30
30
alert ( name ); // John
Original file line number Diff line number Diff line change @@ -2,9 +2,9 @@ importance: 5
2
2
3
3
---
4
4
5
- # The maximal salary
5
+ # Le salaire maximal
6
6
7
- There is a ` salaries ` object:
7
+ Il y a un objet ` salaries ` :
8
8
9
9
``` js
10
10
let salaries = {
@@ -14,9 +14,9 @@ let salaries = {
14
14
};
15
15
```
16
16
17
- Create the function ` topSalary(salaries) ` that returns the name of the top-paid person .
17
+ Créer la fonction ` topSalary(salaries) ` qui renvoie le nom de la personne la mieux payée .
18
18
19
- - If ` salaries ` is empty, it should return ` null ` .
20
- - If there are multiple top-paid persons, return any of them .
19
+ - Si ` salaries ` est vide, devrait retourner ` null ` .
20
+ - S'il y a plusieurs personnes les mieux payées, renvoyez-en une .
21
21
22
- P.S. Use ` Object.entries ` and destructuring to iterate over key/value pairs .
22
+ P.S. Utilisez ` Object.entries ` et la décomposition pour parcourir les paires clé / valeur .
You can’t perform that action at this time.
0 commit comments