Skip to content

Commit 7332fb4

Browse files
authored
Delete and update translation
1 parent 8a6d15b commit 7332fb4

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

6-data-storage/02-localstorage/article.md

+3-7
Original file line numberDiff line numberDiff line change
@@ -42,16 +42,12 @@ localStorage.setItem('test', 1);
4242
alert( localStorage.getItem('test') ); // 1
4343
```
4444

45-
We only have to be on the same origin (domain/port/protocol), the url path can be different.
46-
4745
Kita hanya harus berada di *origin* yang sama (domain/port/protocol), *path* urlnya bisa berbeda.
4846

4947
`localStorage` dibagi antara semua *window* dengan *origin* yang sama, jadi jika kita mengatur data di satu *window*, perubahan akan terlihat di *window* lain.
5048

5149
## Akses seperti objek
5250

53-
We can also use a plain object way of getting/setting keys, like this:
54-
5551
Kita juga dapat menggunakan cara sebuah objek biasa untuk mendapatkan/mengatur *key*, seperti ini:
5652

5753
```js run
@@ -137,15 +133,15 @@ Kita dapat menggunakan `JSON` untuk menyimpan objek:
137133
```js run
138134
localStorage.user = JSON.stringify({name: "John"});
139135
140-
// sometime later
136+
// kemudian
141137
let user = JSON.parse( localStorage.user );
142138
alert( user.name ); // John
143139
```
144140

145141
Juga dimungkinkan untuk *stringify* seluruh objek penyimpanan, sebagai contoh untuk tujuan *debugging*:
146142

147143
```js run
148-
// added formatting options to JSON.stringify to make the object look nicer
144+
// menambahkan opsi pemformatan pada JSON.stringify untuk membuat objek terlihat lebih bagus
149145
alert( JSON.stringify(localStorage, null, 2) );
150146
```
151147

@@ -213,7 +209,7 @@ localStorage.setItem('now', Date.now());
213209

214210
Harap perhatikan bahwa *event* juga berisi: `event.url` -- url dokumen tempat data diperbarui.
215211

216-
Also, `event.storageArea` contains the storage object -- the event is the same for both `sessionStorage` and `localStorage`, so `event.storageArea` references the one that was modified. We may even want to set something back in it, to "respond" to a change.
212+
Selain itu, `event.storageArea` berisi objek penyimpanan -- *event*-nya sama untuk `sessionStorage` dan `localStorage`, jadi `event.storageArea` merujuk ke yang telah dimodifikasi. Kita bahkan mungkin ingin mengatur sesuatu kembali di dalamnya, untuk "merespons" perubahan.
217213

218214
**Itu memungkinkan window yang berbeda dari origin yang sama untuk bertukar pesan.**
219215

0 commit comments

Comments
 (0)