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: src/content/learn/rendering-lists.md
+10-10Lines changed: 10 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -16,9 +16,9 @@ Anda mungkin ingin menampilkan beberapa komponen yang mirip dari sebuah kumpulan
16
16
17
17
</YouWillLearn>
18
18
19
-
## Rendering data from arrays {/*rendering-data-from-arrays*/}
19
+
## Me-*render* data dari seranai {/*rendering-data-from-arrays*/}
20
20
21
-
Say that you have a list of content.
21
+
Misalkan Anda memiliki daftar konten seperti berikut.
22
22
23
23
```js
24
24
<ul>
@@ -30,11 +30,11 @@ Say that you have a list of content.
30
30
</ul>
31
31
```
32
32
33
-
The only difference among those list items is their contents, their data. You will often need to show several instances of the same component using different data when building interfaces: from lists of comments to galleries of profile images. In these situations, you can store that data in JavaScript objects and arrays and use methods like [`map()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map)and[`filter()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/filter)to render lists of components from them.
33
+
Semua anggota dari daftar tersebut memiliki format yang sama. Perbedaan hanya terletak pada isi konten, lebih tepatnya data mereka. Pada beberapa situasi, Anda mungkin harus menampilkan beberapa komponen yang sama dengan data yang berbeda saat membangun antarmuka, seperti daftar komentar atau galeri foto profil. Dalam situasi-situasi tersebut, Anda bisa menyimpan data tersebut ke dalam objek atau seranai JavaScript dengan menggunakan *method*[`map()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map)dan[`filter()`](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array/filter)yang kemudian akan digunakan untuk me-*render* beberapa komponen.
34
34
35
-
Here’s a short example of how to generate a list of items from an array:
35
+
Contoh untuk membuat sebuah daftar dari sebuah seranai:
36
36
37
-
1.**Move**the data into an array:
37
+
1.**Pindahkan** data ke sebuah seranai:
38
38
39
39
```js
40
40
constpeople= [
@@ -46,19 +46,19 @@ const people = [
46
46
];
47
47
```
48
48
49
-
2.**Map**the `people` members into a new array of JSX nodes, `listItems`:
49
+
2.**Petakan**dengan menggunakan *method*`map()` setiap anggota `people` ke sebuah seranai *node* JSX, `listItems`:
0 commit comments