Skip to content

Commit d3ad33e

Browse files
committed
Merge branch 'master' of github.com:javascript-tutorial/en.javascript.info into sync-d10b50ae
2 parents 07cc863 + d10b50a commit d3ad33e

File tree

12 files changed

+14
-14
lines changed

12 files changed

+14
-14
lines changed

1-js/02-first-steps/12-while-for/article.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ For even values of `i`, the `continue` directive stops executing the body and pa
256256
````smart header="The `continue` directive helps decrease nesting"
257257
A loop that shows odd values could look like this:
258258

259-
```js
259+
```js run
260260
for (let i = 0; i < 10; i++) {
261261

262262
if (i % 2) {
@@ -268,7 +268,7 @@ for (let i = 0; i < 10; i++) {
268268

269269
From a technical point of view, this is identical to the example above. Surely, we can just wrap the code in an `if` block instead of using `continue`.
270270

271-
But as a side-effect, this created one more level of nesting (the `alert` call inside the curly braces). If the code inside of`if` is longer than a few lines, that may decrease the overall readability.
271+
But as a side-effect, this created one more level of nesting (the `alert` call inside the curly braces). If the code inside of `if` is longer than a few lines, that may decrease the overall readability.
272272
````
273273
274274
````warn header="No `break/continue` to the right side of '?'"

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ For example:
8686
```js
8787
// backtick quotes ` allow to split the string into multiple lines
8888
let str = `
89-
Ecma International's TC39 is a group of JavaScript developers,
89+
ECMA International's TC39 is a group of JavaScript developers,
9090
implementers, academics, and more, collaborating with the community
9191
to maintain and evolve the definition of JavaScript.
9292
`;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ let id = Symbol();
1818

1919
Upon creation, we can give symbol a description (also called a symbol name), mostly useful for debugging purposes:
2020

21-
```js run
21+
```js
2222
// id is a symbol with the description "id"
2323
let id = Symbol("id");
2424
```

1-js/05-data-types/03-string/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,7 @@ The "right" algorithm to do string comparisons is more complex than it may seem,
534534

535535
So, the browser needs to know the language to compare.
536536

537-
Luckily, all modern browsers (IE10- requires the additional library [Intl.JS](https://github.com/andyearnshaw/Intl.js/)) support the internationalization standard [ECMA 402](http://www.ecma-international.org/ecma-402/1.0/ECMA-402.pdf).
537+
Luckily, all modern browsers (IE10- requires the additional library [Intl.js](https://github.com/andyearnshaw/Intl.js/)) support the internationalization standard [ECMA-402](http://www.ecma-international.org/ecma-402/1.0/ECMA-402.pdf).
538538

539539
It provides a special method to compare strings in different languages, following their rules.
540540

1-js/09-classes/01-class/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ class User {
264264
let user = new User("John");
265265
alert(user.name); // John
266266

267-
user = new User(""); // Name too short.
267+
user = new User(""); // Name is too short.
268268
```
269269

270270
The class declaration creates getters and setters in `User.prototype`, like this:

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,15 +92,15 @@ new Promise((resolve, reject) => {
9292
}).catch(alert); // ReferenceError: blabla is not defined
9393
```
9494

95-
The final `.catch` not only catches explicit rejections, but also occasional errors in the handlers above.
95+
The final `.catch` not only catches explicit rejections, but also accidental errors in the handlers above.
9696

9797
## Rethrowing
9898

9999
As we already noticed, `.catch` at the end of the chain is similar to `try..catch`. We may have as many `.then` handlers as we want, and then use a single `.catch` at the end to handle errors in all of them.
100100

101101
In a regular `try..catch` we can analyze the error and maybe rethrow it if it can't be handled. The same thing is possible for promises.
102102

103-
If we `throw` inside `.catch`, then the control goes to the next closest error handler. And if we handle the error and finish normally, then it continues to the closest successful `.then` handler.
103+
If we `throw` inside `.catch`, then the control goes to the next closest error handler. And if we handle the error and finish normally, then it continues to the next closest successful `.then` handler.
104104

105105
In the example below the `.catch` successfully handles the error:
106106

1-js/11-async/07-microtask-queue/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Why did the `.then` trigger afterwards? What's going on?
2323

2424
## Microtasks queue
2525

26-
Asynchronous tasks need proper management. For that, the Ecma standard specifies an internal queue `PromiseJobs`, more often referred to as the "microtask queue" (ES8 term).
26+
Asynchronous tasks need proper management. For that, the ECMA standard specifies an internal queue `PromiseJobs`, more often referred to as the "microtask queue" (ES8 term).
2727

2828
As stated in the [specification](https://tc39.github.io/ecma262/#sec-jobs-and-job-queues):
2929

1-js/11-async/08-async-await/01-rewrite-async/task.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ function loadJson(url) {
1515
})
1616
}
1717

18-
loadJson('no-such-user.json') // (3)
18+
loadJson('no-such-user.json')
1919
.catch(alert); // Error: 404
2020
```

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ generator.next(4); // --> pass the result into the generator
347347
2. Then, as shown at the picture above, the result of `yield` gets into the `question` variable in the calling code.
348348
3. On `generator.next(4)`, the generator resumes, and `4` gets in as the result: `let result = 4`.
349349

350-
Please note, the outer code does not have to immediately call`next(4)`. It may take time. That's not a problem: the generator will wait.
350+
Please note, the outer code does not have to immediately call `next(4)`. It may take time. That's not a problem: the generator will wait.
351351

352352
For instance:
353353

2-ui/1-document/11-coordinates/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ In practice though, `elem.getBoundingClientRect()` always returns positive width
9191
```warn header="Internet Explorer and Edge: no support for `x/y`"
9292
Internet Explorer and Edge don't support `x/y` properties for historical reasons.
9393
94-
So we can either make a polywill (add getters in `DomRect.prototype`) or just use `top/left`, as they are always the same as `x/y` for positive `width/height`, in particular in the result of `elem.getBoundingClientRect()`.
94+
So we can either make a polyfill (add getters in `DomRect.prototype`) or just use `top/left`, as they are always the same as `x/y` for positive `width/height`, in particular in the result of `elem.getBoundingClientRect()`.
9595
```
9696

9797
```warn header="Coordinates right/bottom are different from CSS position properties"

0 commit comments

Comments
 (0)