Skip to content

Sync with upstream @ cdf382de #59

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 67 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
edfe300
Update article.md
rromanenko Jun 23, 2020
4044b75
Fix typo
dvdvdmt Jun 27, 2020
97a12c4
Update article.md
akymtl Jun 27, 2020
1b1b07e
Update article.md
akymtl Jun 27, 2020
41a1b92
Fix typo in /instanceof section (widow -> Window)
traxium Jun 28, 2020
01e584f
update solution.md
DanGhanbari Jun 28, 2020
74caa86
Typos
peachesontour Jun 30, 2020
de25423
Typos
peachesontour Jun 30, 2020
3e2309c
Update article.md
liuernan Jul 1, 2020
ad0dd99
is 'if' operator?
lumosmind Jul 1, 2020
3eb13d5
Corrected a typo
SakiPgr Jul 2, 2020
eb49cb9
Type mistake
pushpend3r Jul 2, 2020
f0dbc65
Fixed Type
siddharth-golchha Jul 4, 2020
5ac5183
more definitive title
lumosmind Jul 4, 2020
d9ab352
Update article.md
shubham-maurya Jul 5, 2020
8a9f440
Fix error of BigInt
leviding Jul 6, 2020
1ad3c2c
Correct message in sandbox.view iframe
smakhl Jul 7, 2020
23fb044
Update task.md
leviding Jul 7, 2020
9e3065f
Fix a comment
zhang1pr Jul 9, 2020
3852623
8.4 Prototype methods... - Fix code typo
DaliborP Jul 10, 2020
15214dc
Update article.md
haond10adp Jul 10, 2020
56edf4a
minor fix: precedence is 5 according to MDN
mazharz Jul 11, 2020
72482bc
Update article.md
paroche Jul 16, 2020
de13faf
Update bindAll of lodash
leviding Jul 17, 2020
0b7266d
Browser LocalStorage capacity updated to 5 MB.
Pankajtanwarbanna Jul 17, 2020
dfcacf2
Fix minor typo error: ol number
leviding Jul 18, 2020
7480a24
Fix minor typo error: add ol number
leviding Jul 18, 2020
356d527
Fix minor typo error: change when when to when
leviding Jul 18, 2020
0d497c7
Update article.md
leviding Jul 18, 2020
d0474ae
Update article.md
leviding Jul 18, 2020
6800c2a
Update index.html
leviding Jul 18, 2020
3558415
Merge pull request #1977 from peachesontour/patch-1
iliakan Jul 18, 2020
841d750
Merge pull request #2014 from leviding/patch-20
iliakan Jul 18, 2020
55f825c
Merge pull request #2013 from leviding/patch-19
iliakan Jul 18, 2020
b947777
Merge pull request #2012 from leviding/patch-18
iliakan Jul 18, 2020
df9effe
Merge pull request #2011 from Pankajtanwarbanna/patch-1
iliakan Jul 18, 2020
ffbf1a8
Merge pull request #2010 from leviding/patch-17
iliakan Jul 18, 2020
1f6b1c7
Merge pull request #2003 from m47h4r/minor-fix-nullish-coalescing-ope…
iliakan Jul 18, 2020
859fc13
Merge pull request #2001 from haond10adp/master
iliakan Jul 18, 2020
b4dfc5d
Merge pull request #2000 from DaliborP/patch-1
iliakan Jul 18, 2020
6e0944a
Merge pull request #1999 from zhang1pr/master
iliakan Jul 18, 2020
4716d10
Merge pull request #1997 from leviding/patch-15
iliakan Jul 18, 2020
c1767e7
Merge pull request #1996 from smakhl/patch-1
iliakan Jul 18, 2020
a896d3c
Merge pull request #1995 from leviding/patch-14
iliakan Jul 18, 2020
83c01f4
Merge pull request #1993 from shubham-maurya/patch-1
iliakan Jul 18, 2020
5641b17
Merge pull request #1989 from siddharth-golchha/patch-1
iliakan Jul 18, 2020
80f7653
Merge pull request #1987 from pushpend3r/patch-1
iliakan Jul 18, 2020
67e54bf
Merge pull request #1984 from SakiPgr/patch-1
iliakan Jul 18, 2020
e251f05
Merge pull request #1983 from lumosmind/patch-40
iliakan Jul 18, 2020
918947e
Merge pull request #1980 from liuernan/patch-1
iliakan Jul 18, 2020
86222ff
Merge pull request #1978 from peachesontour/patch-2
iliakan Jul 18, 2020
83793dc
Merge pull request #1976 from DanGhanbari/patch-1
iliakan Jul 18, 2020
5e74d7c
Merge pull request #1975 from traxium/patch-1
iliakan Jul 18, 2020
04c0570
Merge pull request #1974 from akymtl/patch-3
iliakan Jul 18, 2020
6acac10
Merge pull request #1973 from akymtl/patch-1
iliakan Jul 18, 2020
668207b
Merge pull request #1972 from dvdvdmt/patch-1
iliakan Jul 18, 2020
ae11710
Merge pull request #1970 from rromanenko/patch-1
iliakan Jul 18, 2020
4fdf4c3
to make binding more clear
lumosmind Jul 21, 2020
b70f949
grammatical fix
lumosmind Jul 21, 2020
f38eb4e
Merge pull request #2021 from lumosmind/patch-44
iliakan Jul 21, 2020
41766c9
grammar fix
lumosmind Jul 23, 2020
8e1f438
Merge pull request #1990 from lumosmind/patch-43
iliakan Jul 23, 2020
dc0d915
Typo
peachesontour Jul 25, 2020
b0464bb
Merge pull request #2028 from peachesontour/patch-1
iliakan Jul 25, 2020
05e1878
refactoring
lumosmind Jul 29, 2020
cdf382d
Merge pull request #2031 from lumosmind/patch-49
iliakan Jul 29, 2020
74267fe
merging all conflicts
iliakan Aug 3, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions 1-js/02-first-steps/05-types/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,11 @@ Mehr über das Arbeiten mit Zahlen erfahren wir in diesem Kapitel <info:number>.

## BigInt

<<<<<<< HEAD
In JavaScript kann der Typ "Zahl" keine ganzzahligen Werte darstellen, die größer als <code>(2<sup>53</sup>-1)</code> (das ist `9007199254740991`) oder kleiner als <code>-(-2<sup>53</sup>-1)</code> für Negative sind. Es handelt sich um eine technische Einschränkung, die durch ihre interne Darstellung bedingt ist.
=======
In JavaScript, the "number" type cannot represent integer values larger than <code>(2<sup>53</sup>-1)</code> (that's `9007199254740991`), or less than <code>-(2<sup>53</sup>-1)</code> for negatives. It's a technical limitation caused by their internal representation.
>>>>>>> cdf382de4cf3ed39ca70cb7df60c4c4886f2d22e

Für die meisten Zwecke reicht das völlig aus, aber manchmal brauchen wir wirklich große Zahlen, z.B. für die Kryptographie oder Zeitstempel mit Mikrosekunden-Genauigkeit.

Expand Down
4 changes: 4 additions & 0 deletions 1-js/02-first-steps/06-alert-prompt-confirm/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ Da wir den Browser als unsere Demo-Umgebung verwenden, wollen wir einige Funktio

## alert

<<<<<<< HEAD
Diese haben wir bereits gesehen. Es zeigt eine Meldung an und wartet darauf, dass der Benutzer "OK" drückt.
=======
This one we've seen already. It shows a message and waits for the user to press "OK".
>>>>>>> cdf382de4cf3ed39ca70cb7df60c4c4886f2d22e

Zum Beispiel:

Expand Down
2 changes: 1 addition & 1 deletion 1-js/02-first-steps/10-ifelse/article.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Conditional operators: if, '?'
# Conditional branching: if, '?'

Sometimes, we need to perform different actions based on different conditions.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ Which behavior is better depends on a particular use case. When zero height is a

## Precedence

The precedence of the `??` operator is rather low: `7` in the [MDN table](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Operator_Precedence#Table).
The precedence of the `??` operator is rather low: `5` in the [MDN table](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Operator_Precedence#Table).

So `??` is evaluated after most other operations, but before `=` and `?`.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function pow(x,n) // <- no space between arguments

let x=prompt("x?",''), n=prompt("n?",'') // <-- technically possible,
// but better make it 2 lines, also there's no spaces and missing ;
if (n<0) // <- no spaces inside (n < 0), and should be extra line above it
if (n<=0) // <- no spaces inside (n <= 0), and should be extra line above it
{ // <- figure bracket on a separate line
// below - long lines can be split into multiple lines for improved readability
alert(`Power ${n} is not supported, please enter an integer number greater than zero`);
Expand All @@ -39,7 +39,7 @@ function pow(x, n) {
let x = prompt("x?", "");
let n = prompt("n?", "");

if (n < 0) {
if (n <= 0) {
alert(`Power ${n} is not supported,
please enter an integer number greater than zero`);
} else {
Expand Down
2 changes: 1 addition & 1 deletion 1-js/04-object-basics/03-garbage-collection/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Simply put, "reachable" values are those that are accessible or usable somehow.

2. Any other value is considered reachable if it's reachable from a root by a reference or by a chain of references.

For instance, if there's an object in a local variable, and that object has a property referencing another object, that object is considered reachable. And those that it references are also reachable. Detailed examples to follow.
For instance, if there's an object in a global variable, and that object has a property referencing another object, that object is considered reachable. And those that it references are also reachable. Detailed examples to follow.

There's a background process in the JavaScript engine that is called [garbage collector](https://en.wikipedia.org/wiki/Garbage_collection_(computer_science)). It monitors all objects and removes those that have become unreachable.

Expand Down
4 changes: 2 additions & 2 deletions 1-js/04-object-basics/08-symbol/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ user.id = "Their id value"
// Boom! overwritten by another script!
```

### Symbols in a literal
### Symbols in an object literal

If we want to use a symbol in an object literal `{...}`, we need square brackets around it.

Expand All @@ -133,7 +133,7 @@ let id = Symbol("id");
let user = {
name: "John",
*!*
[id]: 123 // not "id: 123"
[id]: 123 // not "id": 123
*/!*
};
```
Expand Down
2 changes: 1 addition & 1 deletion 1-js/04-object-basics/09-object-toprimitive/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ There are three variants of type conversion, so-called "hints", described in the
`"default"`
: Occurs in rare cases when the operator is "not sure" what type to expect.

For instance, binary plus `+` can work both with strings (concatenates them) and numbers (adds them), so both strings and numbers would do. So if the a binary plus gets an object as an argument, it uses the `"default"` hint to convert it.
For instance, binary plus `+` can work both with strings (concatenates them) and numbers (adds them), so both strings and numbers would do. So if a binary plus gets an object as an argument, it uses the `"default"` hint to convert it.

Also, if an object is compared using `==` with a string, number or a symbol, it's also unclear which conversion should be done, so the `"default"` hint is used.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function func() {
func();
```

In this example we can observe the peculiar difference between a "non-existing" and "unitialized" variable.
In this example we can observe the peculiar difference between a "non-existing" and "uninitialized" variable.

As you may have read in the article [](info:closure), a variable starts in the "uninitialized" state from the moment when the execution enters a code block (or a function). And it stays uninitalized until the corresponding `let` statement.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ importance: 5

Create a "throttling" decorator `throttle(f, ms)` -- that returns a wrapper.

When it's called multiple times, it passes the call to `f` at maximum once per `ms` milliseconds.
When it's called multiple times, it passes the call to `f` at maximum once per `ms` milliseconds.

The difference with debounce is that it's completely different decorator:
- `debounce` runs the function once after the "cooldown" period. Good for processing the final result.
Expand Down
4 changes: 2 additions & 2 deletions 1-js/06-advanced-functions/10-bind/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ sayHi(); // Hello, John!
setTimeout(sayHi, 1000); // Hello, John!

// even if the value of user changes within 1 second
// sayHi uses the pre-bound value
// sayHi uses the pre-bound value which is reference to the old user object
user = {
sayHi() { alert("Another user in setTimeout!"); }
};
Expand Down Expand Up @@ -202,7 +202,7 @@ for (let key in user) {
}
```

JavaScript libraries also provide functions for convenient mass binding , e.g. [_.bindAll(obj)](http://lodash.com/docs#bindAll) in lodash.
JavaScript libraries also provide functions for convenient mass binding , e.g. [_.bindAll(object, methodNames)](http://lodash.com/docs#bindAll) in lodash.
````

## Partial functions
Expand Down
4 changes: 2 additions & 2 deletions 1-js/08-prototypes/04-prototype-methods/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ The `__proto__` is considered outdated and somewhat deprecated (in browser-only

The modern methods are:

- [Object.create(proto[, descriptors])](mdn:js/Object/create) -- creates an empty object with given `proto` as `[[Prototype]]` and optional property descriptors.
- [Object.create(proto, [descriptors])](mdn:js/Object/create) -- creates an empty object with given `proto` as `[[Prototype]]` and optional property descriptors.
- [Object.getPrototypeOf(obj)](mdn:js/Object/getPrototypeOf) -- returns the `[[Prototype]]` of `obj`.
- [Object.setPrototypeOf(obj, proto)](mdn:js/Object/setPrototypeOf) -- sets the `[[Prototype]]` of `obj` to `proto`.

Expand Down Expand Up @@ -175,7 +175,7 @@ alert(Object.keys(chineseDictionary)); // hello,bye

Modern methods to set up and directly access the prototype are:

- [Object.create(proto[, descriptors])](mdn:js/Object/create) -- creates an empty object with a given `proto` as `[[Prototype]]` (can be `null`) and optional property descriptors.
- [Object.create(proto, [descriptors])](mdn:js/Object/create) -- creates an empty object with a given `proto` as `[[Prototype]]` (can be `null`) and optional property descriptors.
- [Object.getPrototypeOf(obj)](mdn:js/Object.getPrototypeOf) -- returns the `[[Prototype]]` of `obj` (same as `__proto__` getter).
- [Object.setPrototypeOf(obj, proto)](mdn:js/Object.setPrototypeOf) -- sets the `[[Prototype]]` of `obj` to `proto` (same as `__proto__` setter).

Expand Down
2 changes: 1 addition & 1 deletion 1-js/09-classes/06-instanceof/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ For most environment-specific objects, there is such a property. Here are some b

```js run
// toStringTag for the environment-specific object and class:
alert( window[Symbol.toStringTag]); // window
alert( window[Symbol.toStringTag]); // Window
alert( XMLHttpRequest.prototype[Symbol.toStringTag] ); // XMLHttpRequest

alert( {}.toString.call(window) ); // [object Window]
Expand Down
2 changes: 1 addition & 1 deletion 1-js/09-classes/07-mixins/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ let eventMixin = {
* this.trigger('select', data1, data2);
*/
trigger(eventName, ...args) {
if (!this._eventHandlers || !this._eventHandlers[eventName]) {
if (!this._eventHandlers?.[eventName]) {
return; // no handlers for that event name
}

Expand Down
2 changes: 1 addition & 1 deletion 1-js/10-error-handling/1-try-catch/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,7 @@ The "rethrowing" technique can be explained in more detail as:

1. Catch gets all errors.
2. In the `catch(err) {...}` block we analyze the error object `err`.
2. If we don't know how to handle it, we do `throw err`.
3. If we don't know how to handle it, we do `throw err`.

Usually, we can check the error type using the `instanceof` operator:

Expand Down
2 changes: 1 addition & 1 deletion 1-js/11-async/04-promise-error-handling/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ Here the `.catch` block finishes normally. So the next successful `.then` handle
In the example below we see the other situation with `.catch`. The handler `(*)` catches the error and just can't handle it (e.g. it only knows how to handle `URIError`), so it throws it again:

```js run
// the execution: catch -> catch -> then
// the execution: catch -> catch
new Promise((resolve, reject) => {

throw new Error("Whoops!");
Expand Down
6 changes: 3 additions & 3 deletions 1-js/99-js-misc/01-proxy/01-error-nonexisting/task.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Error on reading non-existant property
# Error on reading non-existent property

Usually, an attempt to read a non-existant property returns `undefined`.
Usually, an attempt to read a non-existent property returns `undefined`.

Create a proxy that throws an error for an attempt to read of a non-existant property instead.
Create a proxy that throws an error for an attempt to read of a non-existent property instead.

That can help to detect programming mistakes early.

Expand Down
4 changes: 2 additions & 2 deletions 1-js/99-js-misc/01-proxy/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -840,7 +840,7 @@ So there's no such problem when proxying an array.

### Private fields

The similar thing happens with private class fields.
A similar thing happens with private class fields.

For example, `getName()` method accesses the private `#name` property and breaks after proxying:

Expand Down Expand Up @@ -963,7 +963,7 @@ revoke();
alert(proxy.data); // Error
```

A call to `revoke()` removes all internal references to the target object from the proxy, so they are no more connected. The target object can be garbage-collected after that.
A call to `revoke()` removes all internal references to the target object from the proxy, so they are no longer connected. The target object can be garbage-collected after that.

We can also store `revoke` in a `WeakMap`, to be able to easily find it by a proxy object:

Expand Down
2 changes: 1 addition & 1 deletion 1-js/99-js-misc/05-bigint/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ The conversion operations are always silent, never give errors, but if the bigin
````smart header="The unary plus is not supported on bigints"
The unary plus operator `+value` is a well-known way to convert `value` to a number.

On bigints it's not supported, to avoid confusion:
In order to avoid confusion, it's not supported on bigints:
```js run
let bigint = 1n;

Expand Down
2 changes: 1 addition & 1 deletion 2-ui/1-document/07-modifying-document/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ let div = document.createElement('div');
// 2. Set its class to "alert"
div.className = "alert";

// Fill it with the content
// 3. Fill it with the content
div.innerHTML = "<strong>Hi there!</strong> You've read an important message.";
```

Expand Down
2 changes: 1 addition & 1 deletion 2-ui/2-events/01-introduction-browser-events/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ element.removeEventListener(event, handler, [options]);
````warn header="Removal requires the same function"
To remove a handler we should pass exactly the same function as was assigned.

That doesn't work:
This doesn't work:

```js no-beautify
elem.addEventListener( "click" , () => alert('Thanks!'));
Expand Down
2 changes: 1 addition & 1 deletion 2-ui/2-events/05-dispatch-events/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ Besides, the event class describes "what kind of event" it is, and if the event

## event.preventDefault()

Many browser events have a "default action", such as nagivating to a link, starting a selection, and so on.
Many browser events have a "default action", such as navigating to a link, starting a selection, and so on.

For new, custom events, there are definitely no default browser actions, but a code that dispatches such event may have its own plans what to do after triggering the event.

Expand Down
6 changes: 3 additions & 3 deletions 2-ui/3-event-details/1-mouse-events-basics/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ We've already seen some of these events:
: Triggers after two clicks on the same element within a short timeframe. Rarely used nowadays.

`contextmenu`
: Triggers when when the right mouse button is pressed. There are other ways to open a context menu, e.g. using a special keyboard key, it triggers in that case also, so it's not exactly the mouse event.
: Triggers when the right mouse button is pressed. There are other ways to open a context menu, e.g. using a special keyboard key, it triggers in that case also, so it's not exactly the mouse event.

...There are several other events too, we'll cover them later.

Expand All @@ -34,7 +34,7 @@ As you can see from the list above, a user action may trigger multiple events.

For instance, a left-button click first triggers `mousedown`, when the button is pressed, then `mouseup` and `click` when it's released.

In cases when a single action initiates multiple events, their order is fixed. That is, the handlers are called in the order `mousedown` -> `mouseup` -> `click`.
In cases when a single action initiates multiple events, their order is fixed. That is, the handlers are called in the order `mousedown` -> `mouseup` -> `click`.

```online
Click the button below and you'll see the events. Try double-click too.
Expand All @@ -50,7 +50,7 @@ Also we can see the `button` property that allows to detect the mouse button, it

Click-related events always have the `button` property, which allows to get the exact mouse button.

We usually don't use it for `click` and `contextmenu` events, because the former happens only on left-click, and the latter -- only on right-click.
We usually don't use it for `click` and `contextmenu` events, because the former happens only on left-click, and the latter -- only on right-click.

From the other hand, `mousedown` and `mouseup` handlers we may need `event.button`, because these events trigger on any button, so `button` allows to distinguish between "right-mousedown" and "left-mousedown".

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@


<script>
ball.onmousedown = function(event) {
ball.onmousedown = function(event) {
ball.style.position = 'absolute';
ball.style.zIndex = 1000;
document.body.appendChild(ball);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<body>

<div>The iframe below is has <code>sandbox</code> attribute.</div>
<div>The iframe below has the <code>sandbox</code> attribute.</div>

<iframe sandbox src="sandboxed.html" style="height:60px;width:90%"></iframe>

Expand Down
2 changes: 1 addition & 1 deletion 5-network/05-fetch-crossorigin/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ fetch('http://another.com', {
});
```

Now `fetch` sends cookies originating from `another.com` without request to that site.
Now `fetch` sends cookies originating from `another.com` with request to that site.

If the server agrees to accept the request *with credentials*, it should add a header `Access-Control-Allow-Credentials: true` to the response, in addition to `Access-Control-Allow-Origin`.

Expand Down
2 changes: 1 addition & 1 deletion 5-network/07-url/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ It provides convenient methods for search parameters:
- **`delete(name)`** -- remove the parameter by `name`,
- **`get(name)`** -- get the parameter by `name`,
- **`getAll(name)`** -- get all parameters with the same `name` (that's possible, e.g. `?user=John&user=Pete`),
- **`has(name)`** -- check for the existance of the parameter by `name`,
- **`has(name)`** -- check for the existence of the parameter by `name`,
- **`set(name, value)`** -- set/replace the parameter,
- **`sort()`** -- sort parameters by name, rarely needed,
- ...and it's also iterable, similar to `Map`.
Expand Down
2 changes: 1 addition & 1 deletion 6-data-storage/02-localstorage/article.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ Modern browsers also support [Broadcast channel API](https://developer.mozilla.o

Web storage objects `localStorage` and `sessionStorage` allow to store key/value in the browser.
- Both `key` and `value` must be strings.
- The limit is 2mb+, depends on the browser.
- The limit is 5mb+, depends on the browser.
- They do not expire.
- The data is bound to the origin (domain/port/protocol).

Expand Down