Skip to content

Commit 76370ba

Browse files
committed
Merge branch 'master' of https://github.com/javascript-tutorial/en.javascript.info into sync-273e47b7
2 parents c11aa15 + 273e47b commit 76370ba

File tree

5 files changed

+9
-73
lines changed

5 files changed

+9
-73
lines changed

1-js/05-data-types/02-number/9-random-int-min-max/task.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ Any number from the interval `min..max` must appear with the same probability.
1212
Examples of its work:
1313

1414
```js
15-
alert( random(1, 5) ); // 1
16-
alert( random(1, 5) ); // 3
17-
alert( random(1, 5) ); // 5
15+
alert( randomInteger(1, 5) ); // 1
16+
alert( randomInteger(1, 5) ); // 3
17+
alert( randomInteger(1, 5) ); // 5
1818
```
1919

2020
You can use the solution of the [previous task](info:task/random-min-max) as the base.

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ So far we've seen simple examples, to gain basic understanding. Now let's review
264264

265265
There are many online APIs that deliver paginated data. For instance, when we need a list of users, then we can fetch it page-by-page: a request returns a pre-defined count (e.g. 100 users), and provides an URL to the next page.
266266

267-
The pattern is very common, it's not about users, but just about anything. For instance, Github allows to retrieve commits in the same, paginated fashion:
267+
The pattern is very common, it's not about users, but just about anything. For instance, GitHub allows to retrieve commits in the same, paginated fashion:
268268

269269
- We should make a request to URL in the form `https://api.github.com/repos/<repo>/commits`.
270270
- It responds with a JSON of 30 commits, and also provides a link to the next page in the `Link` header.
@@ -273,7 +273,7 @@ The pattern is very common, it's not about users, but just about anything. For i
273273
What we'd like to have is an iterable source of commits, so that we could use it like this:
274274

275275
```js
276-
let repo = 'javascript-tutorial/en.javascript.info'; // Github repository to get commits from
276+
let repo = 'javascript-tutorial/en.javascript.info'; // GitHub repository to get commits from
277277

278278
for await (let commit of fetchCommits(repo)) {
279279
// process commit
@@ -308,9 +308,9 @@ async function* fetchCommits(repo) {
308308
}
309309
```
310310

311-
1. We use the browser `fetch` method to download from a remote URL. It allows to supply authorization and other headers if needed, here Github requires `User-Agent`.
311+
1. We use the browser `fetch` method to download from a remote URL. It allows to supply authorization and other headers if needed, here GitHub requires `User-Agent`.
312312
2. The fetch result is parsed as JSON, that's again a `fetch`-specific method.
313-
3. We can get the next page URL from the `Link` header of the response. It has a special format, so we use a regexp for that. The next page URL may look like this: `https://api.github.com/repositories/93253246/commits?page=2`, it's generatd by Github itself.
313+
3. We can get the next page URL from the `Link` header of the response. It has a special format, so we use a regexp for that. The next page URL may look like this: `https://api.github.com/repositories/93253246/commits?page=2`, it's generatd by GitHub itself.
314314
4. Then we yield all commits received, and when they finish -- the next `while(url)` iteration will trigger, making one more request.
315315

316316
An example of use (shows commit authors in console):

1-js/13-modules/01-modules-intro/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ If we really need to make a "global" in-browser variable, we can explicitly assi
105105

106106
### A module code is evaluated only the first time when imported
107107

108-
If a same module is imported into multiple other places, it's code is executed only the first time, then exports are given to all importers.
108+
If the same module is imported into multiple other places, its code is executed only the first time, then exports are given to all importers.
109109

110110
That has important consequences. Let's see that on examples.
111111

5-network/01-fetch-basics/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ To get the response body, we need to use an additional method call.
5454
- **`response.arrayBuffer()`** -- return the response as [ArrayBuffer](info:arraybuffer-binary-arrays) (pure binary data),
5555
- additionally, `response.body` is a [ReadableStream](https://streams.spec.whatwg.org/#rs-class) object, it allows to read the body chunk-by-chunk, we'll see an example later.
5656

57-
For instance, here we get a JSON-object with latest commits from Github:
57+
For instance, here we get a JSON-object with latest commits from GitHub:
5858

5959
```js run async
6060
let response = await fetch('https://api.github.com/repos/javascript-tutorial/en.javascript.info/commits');

TRANSLATION.md

Lines changed: 0 additions & 64 deletions
This file was deleted.

0 commit comments

Comments
 (0)