Skip to content

Commit e37d4ac

Browse files
committed
fix
1 parent 1fb7296 commit e37d4ac

File tree

6 files changed

+28
-23
lines changed

6 files changed

+28
-23
lines changed

1-js/02-first-steps/01-hello-world/article.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ Comments before and after scripts.
6363
//--></script>
6464
```
6565

66-
These comments were supposed to hide the code from an old browser that didn't know about a `<script>` tag. But all browsers born in the past 15+ years don't have any issues. It is only mentioned here, because it serves as a sign. If you see that somewhere -- that code is probably really old and not worth looking into.
66+
These comments were supposed to hide the code from an old browser that didn't know about a `<script>` tag. But all browsers born in the past 15+ years don't have any issues. We mention it here, because such comments serve as a sign. If you see that somewhere -- that code is probably really old and not worth looking into.
6767

6868

6969
## External scripts
@@ -105,7 +105,7 @@ That saves traffic and makes pages faster.
105105
```
106106

107107
````warn header="If `src` is set, the script content is ignored."
108-
A single `<script>` tag may not have both, `src` attribute and the code inside.
108+
A single `<script>` tag may not have both `src` attribute and the code inside.
109109

110110
This won't work:
111111

1-js/02-first-steps/09-alert-prompt-confirm/article.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22

33
This part of the tutorial aims to cover JavaScript "as is", without environment-specific tweaks.
44

5-
But still we use a browser as the demo environment. So we should know at least few user-interface functions.
6-
7-
In this chapter we'll get familiar with the browser-specific functions `alert`, `prompt` and `confirm`.
5+
But still we use a browser as the demo environment. So we should know at least few user-interface functions. In this chapter we'll get familiar with the browser functions `alert`, `prompt` and `confirm`.
86

97
[cut]
108

1-js/07-object-oriented-programming/01-property-descriptors/article.md

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,7 @@ user.name = "Alice"; // Error
145145

146146
Now let's add a custom `toString` to `user`.
147147

148-
Normally, a built-in `toString` for objects is non-enumerable, it does not show up in `for..in`. But if we add `toString` of our own, then by default it shows up in `for..in`.
149-
150-
...But if we don't like it, then we can set `enumerable:false`. Then it won't appear in `for..in` loop, just like the built-in one:
148+
Normally, a built-in `toString` for objects is non-enumerable, it does not show up in `for..in`. But if we add `toString` of our own, then by default it shows up in `for..in`, like this:
151149

152150
```js run
153151
let user = {
@@ -159,6 +157,17 @@ let user = {
159157

160158
// By default, both our properties are listed:
161159
for(let key in user) alert(key); // name, toString
160+
```
161+
162+
If we don't like it, then we can set `enumerable:false`. Then it won't appear in `for..in` loop, just like the built-in one:
163+
164+
```js run
165+
let user = {
166+
name: "John",
167+
toString() {
168+
return this.name;
169+
}
170+
};
162171

163172
Object.defineProperty(user, "toString", {
164173
*!*
@@ -167,7 +176,7 @@ Object.defineProperty(user, "toString", {
167176
});
168177

169178
*!*
170-
// Now toString disappears:
179+
// Now our toString disappears:
171180
*/!*
172181
for(let key in user) alert(key); // name
173182
```
@@ -178,11 +187,9 @@ Non-enumerable properties are also excluded from `Object.keys`:
178187
alert(Object.keys(user)); // name
179188
```
180189

181-
182-
183190
## Non-configurable
184191

185-
The non-configurable flag (`configurable:false`) is usually set for built-in objects and properties.
192+
The non-configurable flag (`configurable:false`) is sometimes preset for built-in objects and properties.
186193

187194
A non-configurable property can not be deleted or altered with `defineProperty`.
188195

2-ui/2-events/02-bubbling-and-capturing/bubble-target.view/script.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
let form = document.querySelector('form');
21

32
form.onclick = function(event) {
43
event.target.style.backgroundColor = 'yellow';

3-animation/2-css-animations/1-animate-logo-css/task.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Show the animation like on the picture below (click the plane):
88

99
[iframe src="solution" height=300]
1010

11-
- The picture grows on click from 40x24px to 400x240px.
11+
- The picture grows on click from `40x24px` to `400x240px` (10 times larger).
1212
- The animation takes 3 seconds.
1313
- At the end output: "Done!".
14-
- During the animation process, there may be more clicks. They shouldn't "break" anything.
14+
- During the animation process, there may be more clicks on the plane. They shouldn't "break" anything.

3-animation/2-css-animations/article.md

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -399,24 +399,25 @@ Here's an example with explanations:
399399
</style>
400400
```
401401

402-
There are many articles about `@keyframes` and a [detailed specification](https://drafts.csswg.org/css-animations/), so we won't go into more details here.
402+
There are many articles about `@keyframes` and a [detailed specification](https://drafts.csswg.org/css-animations/).
403403

404-
Probably you won't need it often, unless everything is in the constant move on your sites.
404+
Probably you won't need `@keyframes` often, unless everything is in the constant move on your sites.
405405

406406
## Summary
407407

408-
CSS animations allow to smoothly (or not) animate changes to one or multiple CSS properties.
408+
CSS animations allow to smoothly (or not) animate changes of one or multiple CSS properties.
409409

410410
They are good for most animation tasks. We're also able to use JavaScript for animations, the next chapter is devoted to that.
411411

412412
Limitations of CSS animations compared to JavaScript animations:
413413

414-
```compare
415-
- JavaScript animations are more flexible. They can implement any animation logic, like "explosion" of an element. We can create new elements in JavaScript for purposes of animation.
416-
+ Simple things done simple.
417-
+ Fast and easy for CPU.
414+
```compare plus="CSS animations" minus="JavaScript animations"
415+
+ Simple things done simply.
416+
+ Fast and lightweight for CPU.
417+
- JavaScript animations are flexible. They can implement any animation logic, like an "explosion" of an element.
418+
- Not just property changes. We can create new elements in JavaScript for purposes of animation.
418419
```
419420

420-
The vast majority of animations uses the described CSS properties. And maybe the `transitionend` event to bind some JavaScript after it.
421+
The majority of animations can be implemented using CSS as described in this chapter. And `transitionend` event allows to run JavaScript after the animation, so it integrates fine with the code.
421422

422423
But in the next chapter we'll do some JavaScript animations to cover more complex cases.

0 commit comments

Comments
 (0)