Skip to content

Commit 0c959f9

Browse files
committed
Merge branch 'master' of github.com:javascript-tutorial/en.javascript.info into sync-fc3f811c
2 parents 9c7598e + fc3f811 commit 0c959f9

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ if (cond) {
6868

6969
## The "else" clause
7070

71-
The `if` statement may contain an optional "else" block. It executes when the condition is false.
71+
The `if` statement may contain an optional "else" block. It executes when the condition is falsy.
7272

7373
For example:
7474
```js run

1-js/11-async/05-promise-api/article.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -309,15 +309,15 @@ In practice, this method is almost never used.
309309
310310
## Summary
311311
312-
There are 5 static methods of `Promise` class:
312+
There are 6 static methods of `Promise` class:
313313
314314
1. `Promise.all(promises)` -- waits for all promises to resolve and returns an array of their results. If any of the given promises rejects, it becomes the error of `Promise.all`, and all other results are ignored.
315315
2. `Promise.allSettled(promises)` (recently added method) -- waits for all promises to settle and returns their results as an array of objects with:
316316
- `status`: `"fulfilled"` or `"rejected"`
317317
- `value` (if fulfilled) or `reason` (if rejected).
318318
3. `Promise.race(promises)` -- waits for the first promise to settle, and its result/error becomes the outcome.
319-
4. `Promise.any(promises)` -- waits for the first promise to fulfill, and its result becomes the outcome. If all of the given promises are rejected, [`AggregateError`](mdn:js/AggregateError) becomes the error of `Promise.any`.
319+
4. `Promise.any(promises)` (recently added method) -- waits for the first promise to fulfill, and its result becomes the outcome. If all of the given promises are rejected, [`AggregateError`](mdn:js/AggregateError) becomes the error of `Promise.any`.
320320
5. `Promise.resolve(value)` -- makes a resolved promise with the given value.
321321
6. `Promise.reject(error)` -- makes a rejected promise with the given error.
322322
323-
Of these five, `Promise.all` is probably the most common in practice.
323+
Of all these, `Promise.all` is probably the most common in practice.

2-ui/99-ui-misc/02-selection-range/article.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ We need to create a range, that:
155155
range.setStart(p.firstChild, 2);
156156
range.setEnd(p.querySelector('b').firstChild, 3);
157157
158-
alert(range); // ample: italic and bol
158+
console.log(range); // ample: italic and bol
159159
160160
// use this range for selection (explained later)
161161
window.getSelection().addRange(range);
@@ -244,7 +244,7 @@ Click buttons to run methods on the selection, "resetExample" to reset it.
244244
let newNode = document.createElement('u');
245245
try {
246246
range.surroundContents(newNode);
247-
} catch(e) { alert(e) }
247+
} catch(e) { console.log(e) }
248248
},
249249
resetExample() {
250250
p.innerHTML = `Example: <i>italic</i> and <b>bold</b>`;

0 commit comments

Comments
 (0)