Skip to content

Commit 35b4ca4

Browse files
committed
Merge branch 'master' of github.com:javascript-tutorial/en.javascript.info into sync-ae117106
2 parents 7ca8399 + ae11710 commit 35b4ca4

File tree

26 files changed

+33
-33
lines changed

26 files changed

+33
-33
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
@@ -66,7 +66,7 @@ We'll see more about working with numbers in the chapter <info:number>.
6666

6767
## BigInt
6868

69-
In JavaScript, the "number" type cannot represent integer values larger than <code>(2<sup>53</sup>-1)</code> (that's `9007199254740991`), or less than <code>-(-2<sup>53</sup>-1)</code> for negatives. It's a technical limitation caused by their internal representation.
69+
In JavaScript, the "number" type cannot represent integer values larger than <code>(2<sup>53</sup>-1)</code> (that's `9007199254740991`), or less than <code>-(2<sup>53</sup>-1)</code> for negatives. It's a technical limitation caused by their internal representation.
7070

7171
For most purposes that's quite enough, but sometimes we need really big numbers, e.g. for cryptography or microsecond-precision timestamps.
7272

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
@@ -4,7 +4,7 @@ As we'll be using the browser as our demo environment, let's see a couple of fun
44

55
## alert
66

7-
This one we've seen already. It shows a message and waits for the user to presses "OK".
7+
This one we've seen already. It shows a message and waits for the user to press "OK".
88

99
For example:
1010

1-js/02-first-steps/10-ifelse/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Conditional operators: if, '?'
1+
# Conditional branching: if, '?'
22

33
Sometimes, we need to perform different actions based on different conditions.
44

1-js/02-first-steps/12-nullish-coalescing-operator/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ Which behavior is better depends on a particular use case. When zero height is a
6868
6969
## Precedence
7070
71-
The precedence of the `??` operator is rather low: `7` in the [MDN table](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Operator_Precedence#Table).
71+
The precedence of the `??` operator is rather low: `5` in the [MDN table](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Operator_Precedence#Table).
7272
7373
So `??` is evaluated after most other operations, but before `=` and `?`.
7474

1-js/03-code-quality/02-coding-style/1-style-errors/solution.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ function pow(x,n) // <- no space between arguments
1212

1313
let x=prompt("x?",''), n=prompt("n?",'') // <-- technically possible,
1414
// but better make it 2 lines, also there's no spaces and missing ;
15-
if (n<0) // <- no spaces inside (n < 0), and should be extra line above it
15+
if (n<=0) // <- no spaces inside (n <= 0), and should be extra line above it
1616
{ // <- figure bracket on a separate line
1717
// below - long lines can be split into multiple lines for improved readability
1818
alert(`Power ${n} is not supported, please enter an integer number greater than zero`);
@@ -39,7 +39,7 @@ function pow(x, n) {
3939
let x = prompt("x?", "");
4040
let n = prompt("n?", "");
4141

42-
if (n < 0) {
42+
if (n <= 0) {
4343
alert(`Power ${n} is not supported,
4444
please enter an integer number greater than zero`);
4545
} else {

1-js/04-object-basics/03-garbage-collection/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Simply put, "reachable" values are those that are accessible or usable somehow.
2323

2424
2. Any other value is considered reachable if it's reachable from a root by a reference or by a chain of references.
2525

26-
For instance, if there's an object in a local variable, and that object has a property referencing another object, that object is considered reachable. And those that it references are also reachable. Detailed examples to follow.
26+
For instance, if there's an object in a global variable, and that object has a property referencing another object, that object is considered reachable. And those that it references are also reachable. Detailed examples to follow.
2727

2828
There's a background process in the JavaScript engine that is called [garbage collector](https://en.wikipedia.org/wiki/Garbage_collection_(computer_science)). It monitors all objects and removes those that have become unreachable.
2929

1-js/04-object-basics/08-symbol/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ let id = Symbol("id");
133133
let user = {
134134
name: "John",
135135
*!*
136-
[id]: 123 // not "id: 123"
136+
[id]: 123 // not "id": 123
137137
*/!*
138138
};
139139
```

1-js/04-object-basics/09-object-toprimitive/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ There are three variants of type conversion, so-called "hints", described in the
4646
`"default"`
4747
: Occurs in rare cases when the operator is "not sure" what type to expect.
4848

49-
For instance, binary plus `+` can work both with strings (concatenates them) and numbers (adds them), so both strings and numbers would do. So if the a binary plus gets an object as an argument, it uses the `"default"` hint to convert it.
49+
For instance, binary plus `+` can work both with strings (concatenates them) and numbers (adds them), so both strings and numbers would do. So if a binary plus gets an object as an argument, it uses the `"default"` hint to convert it.
5050

5151
Also, if an object is compared using `==` with a string, number or a symbol, it's also unclear which conversion should be done, so the `"default"` hint is used.
5252

1-js/06-advanced-functions/03-closure/7-let-scope/solution.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ function func() {
1515
func();
1616
```
1717

18-
In this example we can observe the peculiar difference between a "non-existing" and "unitialized" variable.
18+
In this example we can observe the peculiar difference between a "non-existing" and "uninitialized" variable.
1919

2020
As you may have read in the article [](info:closure), a variable starts in the "uninitialized" state from the moment when the execution enters a code block (or a function). And it stays uninitalized until the corresponding `let` statement.
2121

1-js/06-advanced-functions/09-call-apply-decorators/04-throttle/task.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ importance: 5
66

77
Create a "throttling" decorator `throttle(f, ms)` -- that returns a wrapper.
88

9-
When it's called multiple times, it passes the call to `f` at maximum once per `ms` milliseconds.
9+
When it's called multiple times, it passes the call to `f` at maximum once per `ms` milliseconds.
1010

1111
The difference with debounce is that it's completely different decorator:
1212
- `debounce` runs the function once after the "cooldown" period. Good for processing the final result.

0 commit comments

Comments
 (0)