Skip to content

Commit c2c5fcd

Browse files
committed
Merge branch 'master' of github.com:javascript-tutorial/en.javascript.info into sync-ff152b12
2 parents a574f79 + ff152b1 commit c2c5fcd

File tree

28 files changed

+179
-127
lines changed

28 files changed

+179
-127
lines changed

1-js/02-first-steps/05-types/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ The last three lines may need additional explanation:
255255

256256
There are 8 basic data types in JavaScript.
257257

258-
- `number` for numbers of any kind: integer or floating-point, integers are limited by ±2<sup>53</sup>.
258+
- `number` for numbers of any kind: integer or floating-point, integers are limited by <code>±(2<sup>53</sup>-1)</code>.
259259
- `bigint` is for integer numbers of arbitrary length.
260260
- `string` for strings. A string may have zero or more characters, there's no separate single-character type.
261261
- `boolean` for `true`/`false`.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ It shows a modal window with a text message, an input field for the visitor, and
3131
: An optional second parameter, the initial value for the input field.
3232

3333
```smart header="The square brackets in syntax `[...]`"
34-
The square brackets around `default` in the syntax above denote that the parameter as optional, not required.
34+
The square brackets around `default` in the syntax above denote that the parameter is optional, not required.
3535
```
3636
3737
The visitor can type something in the prompt input field and press OK. Then we get that text in the `result`. Or they can cancel the input by pressing Cancel or hitting the `key:Esc` key, then we get `null` as the `result`.

1-js/02-first-steps/08-operators/4-fix-prompt/solution.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ let b = "2"; // prompt("Second number?", 2);
99
alert(a + b); // 12
1010
```
1111

12-
What we should to is to convert strings to numbers before `+`. For example, using `Number()` or prepending them with `+`.
12+
What we should do is to convert strings to numbers before `+`. For example, using `Number()` or
13+
prepending them with `+`.
1314

1415
For example, right before `prompt`:
1516

1-js/02-first-steps/13-while-for/6-repeat-until-correct/solution.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ do {
1010
The loop `do..while` repeats while both checks are truthy:
1111

1212
1. The check for `num <= 100` -- that is, the entered value is still not greater than `100`.
13-
2. The check `&& num` is false when `num` is `null` or a empty string. Then the `while` loop stops too.
13+
2. The check `&& num` is false when `num` is `null` or an empty string. Then the `while` loop stops too.
1414

1515
P.S. If `num` is `null` then `num <= 100` is `true`, so without the 2nd check the loop wouldn't stop if the user clicks CANCEL. Both checks are required.

1-js/04-object-basics/02-object-copy/article.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,6 @@ alert(clone.sizes.width); // 51, see the result from the other one
215215
216216
To fix that, we should use the cloning loop that examines each value of `user[key]` and, if it's an object, then replicate its structure as well. That is called a "deep cloning".
217217
218-
There's a standard algorithm for deep cloning that handles the case above and more complex cases, called the [Structured cloning algorithm](https://html.spec.whatwg.org/multipage/structured-data.html#safe-passing-of-structured-data).
219-
220218
We can use recursion to implement it. Or, not to reinvent the wheel, take an existing implementation, for instance [_.cloneDeep(obj)](https://lodash.com/docs#cloneDeep) from the JavaScript library [lodash](https://lodash.com).
221219
222220
## Summary

1-js/04-object-basics/04-object-methods/4-object-property-this/solution.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ function makeUser() {
77
name: "John",
88
ref: this
99
};
10-
};
10+
}
1111

1212
let user = makeUser();
1313

@@ -45,7 +45,7 @@ function makeUser() {
4545
}
4646
*/!*
4747
};
48-
};
48+
}
4949

5050
let user = makeUser();
5151

1-js/04-object-basics/04-object-methods/4-object-property-this/task.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ function makeUser() {
1414
name: "John",
1515
ref: this
1616
};
17-
};
17+
}
1818

1919
let user = makeUser();
2020

1-js/06-advanced-functions/03-closure/10-make-army/lexenv-makearmy-empty.svg

Lines changed: 1 addition & 0 deletions
Loading

1-js/06-advanced-functions/03-closure/10-make-army/lexenv-makearmy-for-fixed.svg

Lines changed: 1 addition & 0 deletions
Loading

1-js/06-advanced-functions/03-closure/10-make-army/lexenv-makearmy-while-fixed.svg

Lines changed: 1 addition & 0 deletions
Loading

0 commit comments

Comments
 (0)