Skip to content

Commit 9700f82

Browse files
authored
Merge pull request #2283 from leviding/patch-31
FIX: some typo error
2 parents 50c3e3d + 149f63e commit 9700f82

File tree

11 files changed

+21
-21
lines changed

11 files changed

+21
-21
lines changed

1-js/04-object-basics/07-optional-chaining/article.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ The optional chaining `?.` is a safe way to access nested object properties, eve
99

1010
If you've just started to read the tutorial and learn JavaScript, maybe the problem hasn't touched you yet, but it's quite common.
1111

12-
As an example, let's say we have `user` objects that hold the information about our users.
12+
As an example, let's say we have `user` objects that hold the information about our users.
1313

1414
Most of our users have addresses in `user.address` property, with the street `user.address.street`, but some did not provide them.
1515

@@ -21,7 +21,7 @@ let user = {}; // a user without "address" property
2121
alert(user.address.street); // Error!
2222
```
2323

24-
That's the expected result. JavaScript works like this. As `user.address` is `undefined`, an attempt to get `user.address.street` fails with an error.
24+
That's the expected result. JavaScript works like this. As `user.address` is `undefined`, an attempt to get `user.address.street` fails with an error.
2525

2626
In many practical cases we'd prefer to get `undefined` instead of an error here (meaning "no street").
2727

@@ -56,7 +56,7 @@ let user = {}; // user has no address
5656
alert(user.address ? user.address.street ? user.address.street.name : null : null);
5757
```
5858

59-
That's just awful, one may even have problems understanding such code.
59+
That's just awful, one may even have problems understanding such code.
6060

6161
Don't even care to, as there's a better way to write it, using the `&&` operator:
6262

1-js/05-data-types/08-weakmap-weakset/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ let array = [ john ];
3030
john = null; // overwrite the reference
3131

3232
*!*
33-
// the object previously referenced by john is stored inside the array
33+
// the object previously referenced by john is stored inside the array
3434
// therefore it won't be garbage-collected
3535
// we can get it as array[0]
3636
*/!*

1-js/06-advanced-functions/09-call-apply-decorators/03-debounce/task.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ Here's the code for it (uses the debounce decorator from the [Lodash library](ht
2121
```js
2222
let f = _.debounce(alert, 1000);
2323

24-
f("a");
24+
f("a");
2525
setTimeout( () => f("b"), 200);
26-
setTimeout( () => f("c"), 500);
26+
setTimeout( () => f("c"), 500);
2727
// debounced function waits 1000ms after the last call and then runs: alert("c")
2828
```
2929

1-js/08-prototypes/01-prototype-inheritance/article.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ In JavaScript, objects have a special hidden property `[[Prototype]]` (as named
1212

1313
![prototype](object-prototype-empty.svg)
1414

15-
When we read a property from `object`, and it's missing, JavaScript automatically takes it from the prototype. In programming, such thing is called "prototypal inheritance". And soon we'll study many examples of such inheritance, as well as cooler language features built upon it.
15+
When we read a property from `object`, and it's missing, JavaScript automatically takes it from the prototype. In programming, such thing is called "prototypal inheritance". And soon we'll study many examples of such inheritance, as well as cooler language features built upon it.
1616

1717
The property `[[Prototype]]` is internal and hidden, but there are many ways to set it.
1818

@@ -133,11 +133,11 @@ Also it may be obvious, but still: there can be only one `[[Prototype]]`. An obj
133133

134134

135135
```smart header="`__proto__` is a historical getter/setter for `[[Prototype]]`"
136-
It's a common mistake of novice developers not to know the difference between these two.
136+
It's a common mistake of novice developers not to know the difference between these two.
137137

138-
Please note that `__proto__` is *not the same* as the internal `[[Prototype]]` property. It's a getter/setter for `[[Prototype]]`. Later we'll see situations where it matters, for now let's just keep it in mind, as we build our understanding of JavaScript language.
138+
Please note that `__proto__` is *not the same* as the internal `[[Prototype]]` property. It's a getter/setter for `[[Prototype]]`. Later we'll see situations where it matters, for now let's just keep it in mind, as we build our understanding of JavaScript language.
139139

140-
The `__proto__` property is a bit outdated. It exists for historical reasons, modern JavaScript suggests that we should use `Object.getPrototypeOf/Object.setPrototypeOf` functions instead that get/set the prototype. We'll also cover these functions later.
140+
The `__proto__` property is a bit outdated. It exists for historical reasons, modern JavaScript suggests that we should use `Object.getPrototypeOf/Object.setPrototypeOf` functions instead that get/set the prototype. We'll also cover these functions later.
141141

142142
By the specification, `__proto__` must only be supported by browsers. In fact though, all environments including server-side support `__proto__`, so we're quite safe using it.
143143

1-js/11-async/06-promisify/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ As we can see, the new function is a wrapper around the original `loadScript` fu
5050

5151
Now `loadScriptPromise` fits well in promise-based code. If we like promises more than callbacks (and soon we'll see more reasons for that), then we will use it instead.
5252

53-
In practice we may need to promisify more than one function, so it makes sense to use a helper.
53+
In practice we may need to promisify more than one function, so it makes sense to use a helper.
5454

5555
We'll call it `promisify(f)`: it accepts a to-promisify function `f` and returns a wrapper function.
5656

1-js/12-generators-iterators/2-async-iterators-generators/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ More explanations about how it works:
363363
- The initial URL is `https://api.github.com/repos/<repo>/commits`, and the next page will be in the `Link` header of the response.
364364
- The `fetch` method allows us to supply authorization and other headers if needed -- here GitHub requires `User-Agent`.
365365
2. The commits are returned in JSON format.
366-
3. We should get the next page URL from the `Link` header of the response. It has a special format, so we use a regular expression for that (we will lern this feature in [Regular expressions](info:regular-expressions)).
366+
3. We should get the next page URL from the `Link` header of the response. It has a special format, so we use a regular expression for that (we will learn this feature in [Regular expressions](info:regular-expressions)).
367367
- The next page URL may look like `https://api.github.com/repositories/93253246/commits?page=2`. It's generated by GitHub itself.
368368
4. Then we yield the received commits one by one, and when they finish, the next `while(url)` iteration will trigger, making one more request.
369369

5-network/04-fetch-abort/article.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ When `abort()` is called:
2626

2727
Generally, we have two parties in the process:
2828
1. The one that performs an cancelable operation, it sets a listener on `controller.signal`.
29-
2. The one one that cancels: it calls `controller.abort()` when needed.
29+
2. The one that cancels: it calls `controller.abort()` when needed.
3030

3131
Here's the full example (without `fetch` yet):
3232

@@ -50,7 +50,7 @@ As we can see, `AbortController` is just a means to pass `abort` events when `ab
5050

5151
We could implement same kind of event listening in our code on our own, without `AbortController` object at all.
5252

53-
But what's valuable is that `fetch` knows how to work with `AbortController` object, it's integrated with it.
53+
But what's valuable is that `fetch` knows how to work with `AbortController` object, it's integrated with it.
5454

5555
## Using with fetch
5656

5-network/06-fetch-api/article.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,8 @@ Normally, when a document is unloaded, all associated network requests are abort
217217

218218
It has a few limitations:
219219

220-
- We can't send megabytes: the body limit for `keepalive` requests is 64kb.
220+
- We can't send megabytes: the body limit for `keepalive` requests is 64KB.
221221
- If we need to gather a lot of statistics about the visit, we should send it out regularly in packets, so that there won't be a lot left for the last `onunload` request.
222-
- This limit applies to all `keepalive` requests together. In other words, we can perform multiple `keepalive` requests in parallel, but the sum of their body lengths should not exceed 64kb.
223-
- We can't handle the server response if the document is unloaded. So in our example `fetch` will succeed due to `keepalive`, but subsequent functions won't work.
222+
- This limit applies to all `keepalive` requests together. In other words, we can perform multiple `keepalive` requests in parallel, but the sum of their body lengths should not exceed 64KB.
223+
- We can't handle the server response if the document is unloaded. So in our example `fetch` will succeed due to `keepalive`, but subsequent functions won't work.
224224
- In most cases, such as sending out statistics, it's not a problem, as server just accepts the data and usually sends an empty response to such requests.

5-network/10-long-polling/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ As you can see, `subscribe` function makes a fetch, then waits for the response,
7070
```warn header="Server should be ok with many pending connections"
7171
The server architecture must be able to work with many pending connections.
7272
73-
Certain server architectures run one process per connection; resulting in there being as many processes as there are connections, while each process consumes quite a bit of memory. So, too many connections will just consume it all.
73+
Certain server architectures run one process per connection, resulting in there being as many processes as there are connections, while each process consumes quite a bit of memory. So, too many connections will just consume it all.
7474
7575
That's often the case for backends written in languages like PHP and Ruby.
7676

9-regular-expressions/10-regexp-greedy-and-lazy/1-lazy-greedy/task.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
What's the match here?
44

55
```js
6-
"123 456".match(/\d+? \d+?/g) ); // ?
6+
alert( "123 456".match(/\d+? \d+?/g) ); // ?
77
```

0 commit comments

Comments
 (0)