Skip to content

Commit f4ffde0

Browse files
committed
# Conflicts: # 1-js/02-first-steps/05-types/article.md # 1-js/02-first-steps/06-alert-prompt-confirm/article.md # 1-js/02-first-steps/10-ifelse/article.md # 1-js/03-code-quality/02-coding-style/1-style-errors/solution.md
2 parents ca96fc5 + b0464bb commit f4ffde0

File tree

26 files changed

+35
-35
lines changed

26 files changed

+35
-35
lines changed

1-js/02-first-steps/05-types/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ n = 12.345;
6666

6767
## BigInt
6868

69-
В JavaScript, тип "number" не може вміщувати числа більші за <code>2<sup>53</sup></code> (це `9007199254740991`), або менші за <code>-2<sup>53</sup></code> для від'ємних чисел. Це технічне обмеження, викликане їх внутрішніми особливостями.
69+
В JavaScript, тип "number" не може вміщувати числа більші за <code>(2<sup>53</sup>-1)</code> (це `9007199254740991`), або менші за <code>-(2<sup>53</sup>-1)</code> для від'ємних чисел. Це технічне обмеження, викликане їх внутрішніми особливостями.
7070

7171
Для більшості потреб цього достатньо, але бувають випадки, коли нам потрібні дійсно великі числа, наприклад, для криптографії або мікроксекундних часових міток (timestamps).
7272

1-js/02-first-steps/10-ifelse/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Умовні оператори: if, '?'
1+
# Умовні розгалуження: if, '?'
22

33
Іноді нам потрібно виконувати різні дії на основі різних умов.
44

1-js/02-first-steps/12-nullish-coalescing-operator/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ Which behavior is better depends on a particular use case. When zero height is a
6868
6969
## Precedence
7070
71-
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).
71+
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).
7272
7373
So `??` is evaluated after most other operations, but before `=` and `?`.
7474

1-js/03-code-quality/02-coding-style/1-style-errors/solution.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ function pow(x,n) // <- немає пробілу між аргументами
1212

1313
let x=prompt("x?",''), n=prompt("n?",'') // <-- технічно можливо,
1414
// але краще розподілити це на два рядки, також відсутні пробіли і пропущена ;
15-
if (n<0) // <- немає пробілів (n < 0), і перед цим блоком має бути вертикальний відступ (порожній рядок)
15+
if (n<=0) // <- немає пробілів (n <= 0), і перед цим блоком має бути вертикальний відступ (порожній рядок)
1616
{ // <- фігурна дужка на окремому рядку
1717
// нижче - довгий рядок, який можна розділити на декілька, щоб його було простіше прочитати
1818
alert(`Power ${n} is not supported, please enter an integer number greater than zero`);
@@ -39,7 +39,7 @@ function pow(x, n) {
3939
let x = prompt("x?", "");
4040
let n = prompt("n?", "");
4141

42-
if (n < 0) {
42+
if (n <= 0) {
4343
alert(`Power ${n} is not supported,
4444
please enter an integer number greater than zero`);
4545
} else {

1-js/04-object-basics/03-garbage-collection/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Simply put, "reachable" values are those that are accessible or usable somehow.
2323

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

26-
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.
26+
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.
2727

2828
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.
2929

1-js/04-object-basics/08-symbol/article.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ user.id = "Their id value"
121121
// Boom! overwritten by another script!
122122
```
123123

124-
### Symbols in a literal
124+
### Symbols in an object literal
125125

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

@@ -133,7 +133,7 @@ let id = Symbol("id");
133133
let user = {
134134
name: "John",
135135
*!*
136-
[id]: 123 // not "id: 123"
136+
[id]: 123 // not "id": 123
137137
*/!*
138138
};
139139
```

1-js/04-object-basics/09-object-toprimitive/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ There are three variants of type conversion, so-called "hints", described in the
4646
`"default"`
4747
: Occurs in rare cases when the operator is "not sure" what type to expect.
4848

49-
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.
49+
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.
5050

5151
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.
5252

1-js/06-advanced-functions/03-closure/7-let-scope/solution.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ function func() {
1515
func();
1616
```
1717

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

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

1-js/06-advanced-functions/09-call-apply-decorators/04-throttle/task.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ importance: 5
66

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

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

1111
The difference with debounce is that it's completely different decorator:
1212
- `debounce` runs the function once after the "cooldown" period. Good for processing the final result.

1-js/06-advanced-functions/10-bind/article.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ sayHi(); // Hello, John!
167167
setTimeout(sayHi, 1000); // Hello, John!
168168

169169
// even if the value of user changes within 1 second
170-
// sayHi uses the pre-bound value
170+
// sayHi uses the pre-bound value which is reference to the old user object
171171
user = {
172172
sayHi() { alert("Another user in setTimeout!"); }
173173
};
@@ -202,7 +202,7 @@ for (let key in user) {
202202
}
203203
```
204204

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

1-js/08-prototypes/04-prototype-methods/article.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ The `__proto__` is considered outdated and somewhat deprecated (in browser-only
77

88
The modern methods are:
99

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

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

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

178-
- [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.
178+
- [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.
179179
- [Object.getPrototypeOf(obj)](mdn:js/Object.getPrototypeOf) -- returns the `[[Prototype]]` of `obj` (same as `__proto__` getter).
180180
- [Object.setPrototypeOf(obj, proto)](mdn:js/Object.setPrototypeOf) -- sets the `[[Prototype]]` of `obj` to `proto` (same as `__proto__` setter).
181181

1-js/09-classes/06-instanceof/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ For most environment-specific objects, there is such a property. Here are some b
190190
191191
```js run
192192
// toStringTag for the environment-specific object and class:
193-
alert( window[Symbol.toStringTag]); // window
193+
alert( window[Symbol.toStringTag]); // Window
194194
alert( XMLHttpRequest.prototype[Symbol.toStringTag] ); // XMLHttpRequest
195195
196196
alert( {}.toString.call(window) ); // [object Window]

1-js/10-error-handling/1-try-catch/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ The "rethrowing" technique can be explained in more detail as:
363363
364364
1. Catch gets all errors.
365365
2. In the `catch(err) {...}` block we analyze the error object `err`.
366-
2. If we don't know how to handle it, we do `throw err`.
366+
3. If we don't know how to handle it, we do `throw err`.
367367
368368
Usually, we can check the error type using the `instanceof` operator:
369369

1-js/11-async/04-promise-error-handling/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ Here the `.catch` block finishes normally. So the next successful `.then` handle
122122
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:
123123

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

128128
throw new Error("Whoops!");

1-js/99-js-misc/01-proxy/01-error-nonexisting/task.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# Error on reading non-existant property
1+
# Error on reading non-existent property
22

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

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

77
That can help to detect programming mistakes early.
88

1-js/99-js-misc/01-proxy/article.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -840,7 +840,7 @@ So there's no such problem when proxying an array.
840840
841841
### Private fields
842842
843-
The similar thing happens with private class fields.
843+
A similar thing happens with private class fields.
844844
845845
For example, `getName()` method accesses the private `#name` property and breaks after proxying:
846846
@@ -963,7 +963,7 @@ revoke();
963963
alert(proxy.data); // Error
964964
```
965965

966-
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.
966+
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.
967967

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

1-js/99-js-misc/05-bigint/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ The conversion operations are always silent, never give errors, but if the bigin
5050
````smart header="The unary plus is not supported on bigints"
5151
The unary plus operator `+value` is a well-known way to convert `value` to a number.
5252
53-
On bigints it's not supported, to avoid confusion:
53+
In order to avoid confusion, it's not supported on bigints:
5454
```js run
5555
let bigint = 1n;
5656

2-ui/1-document/07-modifying-document/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ let div = document.createElement('div');
6161
// 2. Set its class to "alert"
6262
div.className = "alert";
6363

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

2-ui/2-events/01-introduction-browser-events/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ element.removeEventListener(event, handler, [options]);
236236
````warn header="Removal requires the same function"
237237
To remove a handler we should pass exactly the same function as was assigned.
238238
239-
That doesn't work:
239+
This doesn't work:
240240
241241
```js no-beautify
242242
elem.addEventListener( "click" , () => alert('Thanks!'));

2-ui/2-events/05-dispatch-events/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ Besides, the event class describes "what kind of event" it is, and if the event
162162

163163
## event.preventDefault()
164164

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

167167
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.
168168

2-ui/3-event-details/1-mouse-events-basics/article.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ We've already seen some of these events:
2424
: Triggers after two clicks on the same element within a short timeframe. Rarely used nowadays.
2525

2626
`contextmenu`
27-
: 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.
27+
: 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.
2828

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

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

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

37-
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`.
37+
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`.
3838

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

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

53-
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.
53+
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.
5454

5555
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".
5656

2-ui/3-event-details/4-mouse-drag-and-drop/ball.view/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414

1515
<script>
16-
ball.onmousedown = function(event) {
16+
ball.onmousedown = function(event) {
1717
ball.style.position = 'absolute';
1818
ball.style.zIndex = 1000;
1919
document.body.appendChild(ball);

3-frames-and-windows/03-cross-window-communication/sandbox.view/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
<body>
99

10-
<div>The iframe below is has <code>sandbox</code> attribute.</div>
10+
<div>The iframe below has the <code>sandbox</code> attribute.</div>
1111

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

5-network/05-fetch-crossorigin/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ fetch('http://another.com', {
329329
});
330330
```
331331
332-
Now `fetch` sends cookies originating from `another.com` without request to that site.
332+
Now `fetch` sends cookies originating from `another.com` with request to that site.
333333
334334
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`.
335335

5-network/07-url/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ It provides convenient methods for search parameters:
8888
- **`delete(name)`** -- remove the parameter by `name`,
8989
- **`get(name)`** -- get the parameter by `name`,
9090
- **`getAll(name)`** -- get all parameters with the same `name` (that's possible, e.g. `?user=John&user=Pete`),
91-
- **`has(name)`** -- check for the existance of the parameter by `name`,
91+
- **`has(name)`** -- check for the existence of the parameter by `name`,
9292
- **`set(name, value)`** -- set/replace the parameter,
9393
- **`sort()`** -- sort parameters by name, rarely needed,
9494
- ...and it's also iterable, similar to `Map`.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ Modern browsers also support [Broadcast channel API](https://developer.mozilla.o
222222

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

0 commit comments

Comments
 (0)