You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 1-js/05-data-types/10-date/3-weekday/task.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ importance: 5
4
4
5
5
# European weekday
6
6
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`.
Now let's say we have an array `[3, 5, 1]`. How do we call `Math.max` with it?
137
137
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:
139
139
140
140
```js run
141
141
let arr = [3, 5, 1];
@@ -145,7 +145,7 @@ alert( Math.max(arr) ); // NaN
145
145
*/!*
146
146
```
147
147
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.
149
149
150
150
*Spread operator* to the rescue! It looks similar to rest parameters, also using `...`, but does quite the opposite.
Copy file name to clipboardExpand all lines: 2-ui/1-document/03-dom-navigation/article.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,9 +7,9 @@ libs:
7
7
8
8
# Walking the DOM
9
9
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.
11
11
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.
13
13
14
14
Here's a picture of links that allow to travel between DOM nodes:
15
15
@@ -273,7 +273,7 @@ Certain types of DOM elements may provide additional properties, specific to the
273
273
274
274
Tables are a great example and important particular case of that.
275
275
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:
277
277
- `table.rows` -- the collection of `<tr>` elements of the table.
278
278
- `table.caption/tHead/tFoot` -- references to elements `<caption>`, `<thead>`, `<tfoot>`.
279
279
- `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.
283
283
284
284
**`<tr>`:**
285
285
- `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).
288
288
289
289
**`<td>` and `<th>`:**
290
290
- `td.cellIndex` -- the number of the cell inside the enclosing `<tr>`.
Copy file name to clipboardExpand all lines: 2-ui/1-document/11-coordinates/article.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -55,7 +55,7 @@ If we compare window coordinates versus CSS positioning, then there are obvious
55
55
56
56
But in CSS the `right` property means the distance from the right edge, and the `bottom` -- from the bottom edge.
57
57
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.
Copy file name to clipboardExpand all lines: 2-ui/2-events/03-event-delegation/article.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
2
2
# Event delegation
3
3
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*.
5
5
6
6
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.
0 commit comments