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/02-first-steps/01-hello-world/article.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -63,7 +63,7 @@ Comments before and after scripts.
63
63
//--></script>
64
64
```
65
65
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.
67
67
68
68
69
69
## External scripts
@@ -105,7 +105,7 @@ That saves traffic and makes pages faster.
105
105
```
106
106
107
107
````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.
Copy file name to clipboardExpand all lines: 1-js/02-first-steps/09-alert-prompt-confirm/article.md
+1-3Lines changed: 1 addition & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,9 +2,7 @@
2
2
3
3
This part of the tutorial aims to cover JavaScript "as is", without environment-specific tweaks.
4
4
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`.
Copy file name to clipboardExpand all lines: 1-js/07-object-oriented-programming/01-property-descriptors/article.md
+14-7Lines changed: 14 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -145,9 +145,7 @@ user.name = "Alice"; // Error
145
145
146
146
Now let's add a custom `toString` to `user`.
147
147
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:
151
149
152
150
```js run
153
151
let user = {
@@ -159,6 +157,17 @@ let user = {
159
157
160
158
// By default, both our properties are listed:
161
159
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:
Copy file name to clipboardExpand all lines: 3-animation/2-css-animations/article.md
+9-8Lines changed: 9 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -399,24 +399,25 @@ Here's an example with explanations:
399
399
</style>
400
400
```
401
401
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/).
403
403
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.
405
405
406
406
## Summary
407
407
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.
409
409
410
410
They are good for most animation tasks. We're also able to use JavaScript for animations, the next chapter is devoted to that.
411
411
412
412
Limitations of CSS animations compared to JavaScript animations:
413
413
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.
- 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.
418
419
```
419
420
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.
421
422
422
423
But in the next chapter we'll do some JavaScript animations to cover more complex cases.
0 commit comments