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
+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
@@ -46,7 +46,7 @@ The `<script>` tag contains JavaScript code which is automatically executed when
46
46
The `<script>` tag has a few attributes that are rarely used nowadays but can still be found in old code:
47
47
48
48
The `type` attribute: <code><script <u>type</u>=...></code>
49
-
: The old HTML standard, HTML4, required a script to have a `type`. Usually it was `type="text/javascript"`. It's not required anymore. Also, the modern HTML standard totally changed the meaning of this attribute. Now, it can be used for JavaScript modules. But that's an advanced topic; we'll talk about modules in another part of the tutorial.
49
+
: The old HTML standard, HTML4, required a script to have a `type`. Usually it was `type="text/javascript"`. It's not required anymore. Also, the modern HTML standard totally changed the meaning of this attribute. Now, it can be used for JavaScript modules. But that's an advanced topic, we'll talk about modules in another part of the tutorial.
50
50
51
51
The `language` attribute: <code><script <u>language</u>=...></code>
52
52
: This attribute was meant to show the language of the script. This attribute no longer makes sense because JavaScript is the default language. There is no need to use it.
Copy file name to clipboardExpand all lines: 1-js/04-object-basics/01-object/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
@@ -103,7 +103,7 @@ user.likes birds = true
103
103
104
104
JavaScript doesn't understand that. It thinks that we address `user.likes`, and then gives a syntax error when comes across unexpected `birds`.
105
105
106
-
The dot requires the key to be a valid variable identifier. That implies: contains no spaces, doesn't start with a digit and doesn't include special characters (`$`и`_` are allowed).
106
+
The dot requires the key to be a valid variable identifier. That implies: contains no spaces, doesn't start with a digit and doesn't include special characters (`$`and`_` are allowed).
107
107
108
108
There's an alternative "square bracket notation" that works with any string:
Copy file name to clipboardExpand all lines: 1-js/05-data-types/02-number/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
@@ -324,7 +324,7 @@ Please note that an empty or a space-only string is treated as `0` in all numeri
324
324
325
325
```smart header="Compare with `Object.is`"
326
326
327
-
There is a special built-in method [Object.is](mdn:js/Object/is) that compares values like `===`, but is more reliable for two edge cases:
327
+
There is a special built-in method [`Object.is`](mdn:js/Object/is) that compares values like `===`, but is more reliable for two edge cases:
328
328
329
329
1. It works with `NaN`: `Object.is(NaN, NaN) === true`, that's a good thing.
330
330
2. Values `0` and `-0` are different: `Object.is(0, -0) === false`, technically that's true, because internally the number has a sign bit that may be different even if all other bits are zeroes.
@@ -417,7 +417,7 @@ To write numbers with many zeroes:
417
417
418
418
For different numeral systems:
419
419
420
-
- Can write numbers directly in hex (`0x`), octal (`0o`) and binary (`0b`) systems
420
+
- Can write numbers directly in hex (`0x`), octal (`0o`) and binary (`0b`) systems.
421
421
- `parseInt(str, base)` parses the string `str` into an integer in numeral system with given `base`, `2 ≤ base ≤ 36`.
422
422
- `num.toString(base)` converts a number to a string in the numeral system with the given `base`.
Here we can even more clearer see that there are multiple objects, each one has the `value` and `next` pointing to the neighbour. The `list` variable is the first object in the chain, so following `next` pointers from it we can reach any element.
465
+
Here we can even more clearly see that there are multiple objects, each one has the `value` and `next` pointing to the neighbour. The `list` variable is the first object in the chain, so following `next` pointers from it we can reach any element.
466
466
467
467
The list can be easily split into multiple parts and later joined back:
This way of copying an object is much shorter than `let objCopy = Object.assign({}, obj);` or for an array `let arrCopy = Object.assign([], arr);` so we prefer to use it whenever we can.
271
+
272
+
228
273
## Summary
229
274
230
275
When we see `"..."` in the code, it is either rest parameters or the spread syntax.
Copy file name to clipboardExpand all lines: 1-js/06-advanced-functions/03-closure/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
@@ -200,7 +200,7 @@ Rectangles on the right-hand side demonstrate how the global Lexical Environment
200
200
>>>>>>> a0bfa924a17cad8e7fee213904b27dbf57c2dbac
201
201
=======
202
202
1. When the script starts, the Lexical Environment is pre-populated with all declared variables.
203
-
- Initially, they are in the "Uninitialized" state. That's a special internal state, it means that the engine knows about the variable, but won't allow to use it before`let`. It's almost the same as if the variable didn't exist.
203
+
- Initially, they are in the "Uninitialized" state. That's a special internal state, it means that the engine knows about the variable, but it cannot be referenced until it has been declared with`let`. It's almost the same as if the variable didn't exist.
204
204
2. Then `let phrase` definition appears. There's no assignment yet, so its value is `undefined`. We can use the variable since this moment.
Copy file name to clipboardExpand all lines: 2-ui/1-document/11-coordinates/1-find-point-coordinates/solution.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,6 +1,6 @@
1
1
# Outer corners
2
2
3
-
Outer corners are basically what we get from [elem.getBoundingClientRect()](https://developer.mozilla.org/en-US/docs/DOM/element.getBoundingClientRect).
3
+
Outer corners are basically what we get from [elem.getBoundingClientRect()](https://developer.mozilla.org/en-US/docs/DOM/element.getBoundingClientRect).
4
4
5
5
Coordinates of the upper-left corner `answer1` and the bottom-right corner `answer2`:
Copy file name to clipboardExpand all lines: 2-ui/2-events/02-bubbling-and-capturing/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
@@ -204,7 +204,7 @@ elem.addEventListener("click", e => alert(2));
204
204
205
205
When an event happens -- the most nested element where it happens gets labeled as the "target element" (`event.target`).
206
206
207
-
- Then the event moves down from the document root to `event.target`, calling handlers assigned with `addEventListener(...., true)` on the way (`true` is a shorthand for `{capture: true}`).
207
+
- Then the event moves down from the document root to `event.target`, calling handlers assigned with `addEventListener(..., true)` on the way (`true` is a shorthand for `{capture: true}`).
208
208
- Then handlers are called on the target element itself.
209
209
- Then the event bubbles up from `event.target` up to the root, calling handlers assigned using `on<event>` and `addEventListener` without the 3rd argument or with the 3rd argument `false/{capture:false}`.
0 commit comments