File tree Expand file tree Collapse file tree 3 files changed +133
-131
lines changed
1-js/05-data-types/10-destructuring-assignment Expand file tree Collapse file tree 3 files changed +133
-131
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
+ # Destrukturisasi penugasan
6
6
7
- We have an object :
7
+ Kita mempunyai sebuah objek :
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
+ Tulis destrukturisasi penugasan yang terbaca :
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 no such property )
18
+ - ` name ` properti menjadi variabel ` name ` .
19
+ - ` years ` properti menjadi variabel ` age ` .
20
+ - ` isAdmin ` properti menjadi variabel ` isAdmin ` (false, jika tidak ada properti seperti itu )
21
21
22
- Here's an example of the values after your assignment :
22
+ Berikut adalah contoh nilai setelah penugasan Anda :
23
23
24
24
``` js
25
25
let user = { name: " John" , years: 30 };
26
26
27
- // your code to the left side :
27
+ // kode Anda ke sisi kiri :
28
28
// ... = user
29
29
30
30
alert ( name ); // John
Original file line number Diff line number Diff line change 1
- importance : 5
1
+ nilai penting : 5
2
2
3
3
---
4
4
5
- # The maximal salary
5
+ # Gaji maksimal
6
6
7
- There is a ` salaries ` object :
7
+ Ada objek ` 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
+ Buatlah fungsi ` topSalary(salaries) ` yang mengembalikan nama orang dengan bayaran tertinggi .
18
18
19
- - If ` salaries ` is empty, it should return ` null ` .
20
- - If there are multiple top-paid persons, return any of them .
19
+ - Jika ` gaji ` kosong, itu harus mengembalikan ` null` .
20
+ - Jika ada beberapa orang bergaji tinggi, kembalikan salah satu dari mereka .
21
21
22
- P.S. Use ` Object.entries ` and destructuring to iterate over key/value pairs .
22
+ N.B. Gunakan ` Object.entries ` dan destrukturisasi untuk meng-iterasi lewat pasangan kunci/nilai .
You can’t perform that action at this time.
0 commit comments