Skip to content

Commit 26ec750

Browse files
committed
Update from source
Merge branch 'master' of https://github.com/iliakan/javascript-tutorial-en
2 parents 6f446cc + d8d5086 commit 26ec750

File tree

10 files changed

+16
-16
lines changed

10 files changed

+16
-16
lines changed

1-js/02-first-steps/14-function-basics/4-pow/solution.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ function pow(x, n) {
1313
let x = prompt("x?", '');
1414
let n = prompt("n?", '');
1515

16-
if (n <= 1) {
16+
if (n < 1) {
1717
alert(`Power ${n} is not supported,
1818
use an integer greater than 0`);
1919
} else {

1-js/02-first-steps/14-function-basics/4-pow/task.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Write a function `pow(x,n)` that returns `x` in power `n`. Or, in other words, m
99
```js
1010
pow(3, 2) = 3 * 3 = 9
1111
pow(3, 3) = 3 * 3 * 3 = 27
12-
pow(1, 100) = 1 * 1 * ...*1 = 1
12+
pow(1, 100) = 1 * 1 * ...* 1 = 1
1313
```
1414

1515
Create a web-page that prompts for `x` and `n`, and then shows the result of `pow(x,n)`.

1-js/05-data-types/03-string/3-truncate/_js.view/test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
describe("truncate", function() {
2-
it("truncate the long string to the given lenth (including the ellipsis)", function() {
2+
it("truncate the long string to the given length (including the ellipsis)", function() {
33
assert.equal(
44
truncate("What I'd like to tell on this topic is:", 20),
55
"What I'd like to te…"
@@ -13,4 +13,4 @@ describe("truncate", function() {
1313
);
1414
});
1515

16-
});
16+
});

1-js/05-data-types/10-date/3-weekday/task.md

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

55
# European weekday
66

7-
European countries have days of week starting with monday (number 1), then tuesday (number 2) and till sunday (number 7). Write a function `getLocalDay(date)` that returns the "european" day of week for `date`.
7+
European countries have days of week starting with Monday (number 1), then Tuesday (number 2) and till Sunday (number 7). Write a function `getLocalDay(date)` that returns the "European" day of week for `date`.
88

99
```js no-beautify
1010
let date = new Date(2012, 0, 3); // 3 Jan 2012

1-js/05-data-types/11-json/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ let meetup = {
131131
title: "Conference",
132132
*!*
133133
room: {
134-
number: 123,
134+
number: 23,
135135
participants: ["john", "ann"]
136136
}
137137
*/!*

1-js/06-advanced-functions/02-rest-parameters-spread-operator/article.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ alert( Math.max(3, 5, 1) ); // 5
135135

136136
Now let's say we have an array `[3, 5, 1]`. How do we call `Math.max` with it?
137137

138-
Passing it "as it" won't work, because `Math.max` expects a list of numeric arguments, not a single array:
138+
Passing it "as is" won't work, because `Math.max` expects a list of numeric arguments, not a single array:
139139

140140
```js run
141141
let arr = [3, 5, 1];
@@ -145,7 +145,7 @@ alert( Math.max(arr) ); // NaN
145145
*/!*
146146
```
147147

148-
And surely we can't manually list items in the code `Math.max(arg[0], arg[1], arg[2])`, because we may be unsure how many there are. As our script executes, there could be a lot, or there could be none. And that would get ugly.
148+
And surely we can't manually list items in the code `Math.max(arr[0], arr[1], arr[2])`, because we may be unsure how many there are. As our script executes, there could be a lot, or there could be none. And that would get ugly.
149149

150150
*Spread operator* to the rescue! It looks similar to rest parameters, also using `...`, but does quite the opposite.
151151

2-ui/1-document/03-dom-navigation/article.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ libs:
77

88
# Walking the DOM
99

10-
DOM allows to do anything with elements and their contents, but first we need to reach the corresponding DOM object, get it into a variable, and then we are able to modify it.
10+
The DOM allows to do anything with elements and their contents, but first we need to reach the corresponding DOM object, get it into a variable, and then we are able to modify it.
1111

12-
All operations on DOM start with the `document` object. From it we can access any node.
12+
All operations on the DOM start with the `document` object. From it we can access any node.
1313

1414
Here's a picture of links that allow to travel between DOM nodes:
1515

@@ -273,7 +273,7 @@ Certain types of DOM elements may provide additional properties, specific to the
273273
274274
Tables are a great example and important particular case of that.
275275
276-
**`<table>`** element supports (in addition to the given above) these properties:
276+
**The `<table>`** element supports (in addition to the given above) these properties:
277277
- `table.rows` -- the collection of `<tr>` elements of the table.
278278
- `table.caption/tHead/tFoot` -- references to elements `<caption>`, `<thead>`, `<tfoot>`.
279279
- `table.tBodies` -- the collection of `<tbody>` elements (can be many according to the standard).
@@ -283,8 +283,8 @@ Tables are a great example and important particular case of that.
283283
284284
**`<tr>`:**
285285
- `tr.cells` -- the collection of `<td>` and `<th>` cells inside the given `<tr>`.
286-
- `tr.sectionRowIndex` -- the number of the given `<tr>` inside the enclosing `<thead>/<tbody>`.
287-
- `tr.rowIndex` -- the number of the `<tr>` in the table.
286+
- `tr.sectionRowIndex` -- the position (index) of the given `<tr>` inside the enclosing `<thead>/<tbody>/<tfoot>`.
287+
- `tr.rowIndex` -- the number of the `<tr>` in the table as a whole (including all table rows).
288288
289289
**`<td>` and `<th>`:**
290290
- `td.cellIndex` -- the number of the cell inside the enclosing `<tr>`.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ If we compare window coordinates versus CSS positioning, then there are obvious
5555
5656
But in CSS the `right` property means the distance from the right edge, and the `bottom` -- from the bottom edge.
5757
58-
If we just look at the picture below, we can see that in JavaScript it is not so. All window coordinates are counted from the upper-left corner, including these ones.
58+
If we just look at the picture above, we can see that in JavaScript it is not so. All window coordinates are counted from the upper-left corner, including these ones.
5959
```
6060

6161
## elementFromPoint(x, y) [#elementFromPoint]

2-ui/2-events/03-event-delegation/article.md

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

22
# Event delegation
33

4-
Capturing and bubbling allow to implement one of most powerful event handling patterns called *event delegation*.
4+
Capturing and bubbling allow us to implement one of most powerful event handling patterns called *event delegation*.
55

66
The idea is that if we have a lot of elements handled in a similar way, then instead of assigning a handler to each of them -- we put a single handler on their common ancestor.
77

6-async/03-promise-chaining/02-error-async/task.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Error in setTimeout
22

3-
How do you think, does the `.catch` trigger? Explain your answer?
3+
What do you think? Will the `.catch` trigger? Explain your answer.
44

55
```js
66
new Promise(function(resolve, reject) {

0 commit comments

Comments
 (0)