Skip to content

Commit b0ea614

Browse files
authored
Merge pull request #66 from purwnt/master
Destructuring assignment
2 parents a5259a2 + 9c79b56 commit b0ea614

File tree

3 files changed

+133
-131
lines changed

3 files changed

+133
-131
lines changed

1-js/05-data-types/10-destructuring-assignment/1-destruct-user/task.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ importance: 5
22

33
---
44

5-
# Destructuring assignment
5+
# Destrukturisasi penugasan
66

7-
We have an object:
7+
Kita mempunyai sebuah objek:
88

99
```js
1010
let user = {
@@ -13,18 +13,18 @@ let user = {
1313
};
1414
```
1515

16-
Write the destructuring assignment that reads:
16+
Tulis destrukturisasi penugasan yang terbaca:
1717

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)
2121

22-
Here's an example of the values after your assignment:
22+
Berikut adalah contoh nilai setelah penugasan Anda:
2323

2424
```js
2525
let user = { name: "John", years: 30 };
2626

27-
// your code to the left side:
27+
// kode Anda ke sisi kiri:
2828
// ... = user
2929

3030
alert( name ); // John
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
importance: 5
1+
nilai penting: 5
22

33
---
44

5-
# The maximal salary
5+
# Gaji maksimal
66

7-
There is a `salaries` object:
7+
Ada objek `salaries`:
88

99
```js
1010
let salaries = {
@@ -14,9 +14,9 @@ let salaries = {
1414
};
1515
```
1616

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.
1818

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.
2121

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.

0 commit comments

Comments
 (0)