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: 6-data-storage/02-localstorage/article.md
+3-3
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,7 @@ We already have cookies. Why additional objects?
10
10
- Also unlike cookies, the server can't manipulate storage objects via HTTP headers. Everything's done in JavaScript.
11
11
- The storage is bound to the origin (domain/protocol/port triplet). That is, different protocols or subdomains infer different storage objects, they can't access data from each other.
12
12
13
-
Both storage objects provide same methods and properties:
13
+
Both storage objects provide the same methods and properties:
14
14
15
15
-`setItem(key, value)` -- store key/value pair.
16
16
-`getItem(key)` -- get the value by key.
@@ -124,7 +124,7 @@ The latter works, because `Object.keys` only returns the keys that belong to the
124
124
125
125
Please note that both key and value must be strings.
126
126
127
-
If were any other type, like a number, or an object, it gets converted to string automatically:
127
+
If they were any other type, like a number, or an object, they would get converted to a string automatically:
128
128
129
129
```js run
130
130
localStorage.user = {name: "John"};
@@ -219,7 +219,7 @@ Modern browsers also support [Broadcast channel API](mdn:/api/Broadcast_Channel_
219
219
220
220
## Summary
221
221
222
-
Web storage objects `localStorage` and `sessionStorage` allow to store key/value in the browser.
222
+
Web storage objects `localStorage` and `sessionStorage` allow to store key/value pairs in the browser.
0 commit comments