Skip to content

Commit 6d44c1e

Browse files
committed
fixes
1 parent 7418213 commit 6d44c1e

File tree

5 files changed

+7
-8
lines changed

5 files changed

+7
-8
lines changed

1-js/05-data-types/05-array-methods/article.md

+3-4
Original file line numberDiff line numberDiff line change
@@ -160,13 +160,13 @@ For instance:
160160
let arr = [1, 2];
161161

162162
// create an array from: arr and [3,4]
163-
alert( arr.concat([3, 4])); // 1,2,3,4
163+
alert( arr.concat([3, 4]) ); // 1,2,3,4
164164

165165
// create an array from: arr and [3,4] and [5,6]
166-
alert( arr.concat([3, 4], [5, 6])); // 1,2,3,4,5,6
166+
alert( arr.concat([3, 4], [5, 6]) ); // 1,2,3,4,5,6
167167

168168
// create an array from: arr and [3,4], then add values 5 and 6
169-
alert( arr.concat([3, 4], 5, 6)); // 1,2,3,4,5,6
169+
alert( arr.concat([3, 4], 5, 6) ); // 1,2,3,4,5,6
170170
```
171171

172172
Normally, it only copies elements from arrays. Other objects, even if they look like arrays, are added as a whole:
@@ -180,7 +180,6 @@ let arrayLike = {
180180
};
181181

182182
alert( arr.concat(arrayLike) ); // 1,2,[object Object]
183-
//[1, 2, arrayLike]
184183
```
185184

186185
...But if an array-like object has a special `Symbol.isConcatSpreadable` property, then it's treated as an array by `concat`: its elements are added instead:

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ As you can see, `x/y` and `width/height` fully describe the rectangle. Derived p
6969

7070
Please note:
7171

72-
- Coordinates may be decimal fractions, such as `10.5`. That's normal, internally browser uses fractions in calculations. We don't have to round them when setting to `style.position.left/top`.
72+
- Coordinates may be decimal fractions, such as `10.5`. That's normal, internally browser uses fractions in calculations. We don't have to round them when setting to `style.left/top`.
7373
- Coordinates may be negative. For instance, if the page is scrolled so that `elem` is now above the window, then `elem.getBoundingClientRect().top` is negative.
7474

7575
```smart header="Why derived properties are needed? Why does `top/left` exist if there's `x/y`?"

2-ui/2-events/01-introduction-browser-events/04-move-ball-field/move-ball-coords.svg

+1-1
Loading

2-ui/2-events/01-introduction-browser-events/04-move-ball-field/solution.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Then the ball will be positioned relatively to the field:
2222
}
2323
```
2424

25-
Next we need to assign the correct `ball.style.position.left/top`. They contain field-relative coordinates now.
25+
Next we need to assign the correct `ball.style.left/top`. They contain field-relative coordinates now.
2626

2727
Here's the picture:
2828

@@ -36,7 +36,7 @@ To get field-relative `left` coordinate of the click, we can substract the field
3636
let left = event.clientX - fieldCoords.left - field.clientLeft;
3737
```
3838

39-
Normally, `ball.style.position.left` means the "left edge of the element" (the ball). So if we assign that `left`, then the ball edge, not center, would be under the mouse cursor.
39+
Normally, `ball.style.left` means the "left edge of the element" (the ball). So if we assign that `left`, then the ball edge, not center, would be under the mouse cursor.
4040

4141
We need to move the ball half-width left and half-height up to make it center.
4242

figures.sketch

431 KB
Binary file not shown.

0 commit comments

Comments
 (0)