Skip to content

Commit 05475a3

Browse files
committed
Merge branch 'master' of github.com:javascript-tutorial/en.javascript.info into sync-0e4f5e42
2 parents a1254b7 + 0e4f5e4 commit 05475a3

File tree

22 files changed

+55
-45
lines changed

22 files changed

+55
-45
lines changed

1-js/01-getting-started/3-code-editors/article.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ In practice, lightweight editors may have a lot of plugins including directory-l
3232
The following options deserve your attention:
3333

3434
- [Atom](https://atom.io/) (cross-platform, free).
35+
- [Visual Studio Code](https://code.visualstudio.com/) (cross-platform, free).
3536
- [Sublime Text](http://www.sublimetext.com) (cross-platform, shareware).
3637
- [Notepad++](https://notepad-plus-plus.org/) (Windows, free).
3738
- [Vim](http://www.vim.org/) and [Emacs](https://www.gnu.org/software/emacs/) are also cool if you know how to use them.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ Comments before and after scripts.
6060
//--></script>
6161
```
6262

63-
This trick isn't used in modern JavaScript. These comments hid JavaScript code from old browsers that didn't know how to process the `<script>` tag. Since browsers released in the last 15 years don't have this issue, this kind of comment can help you identify really old code.
63+
This trick isn't used in modern JavaScript. These comments hide JavaScript code from old browsers that didn't know how to process the `<script>` tag. Since browsers released in the last 15 years don't have this issue, this kind of comment can help you identify really old code.
6464

6565

6666
## External scripts

1-js/02-first-steps/04-variables/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ To declare a constant (unchanging) variable, use `const` instead of `let`:
237237
const myBirthday = '18.04.1982';
238238
```
239239
240-
Variables declared using `const` are called "constants". They cannot be changed. An attempt to do so would cause an error:
240+
Variables declared using `const` are called "constants". They cannot be reassigned. An attempt to do so would cause an error:
241241
242242
```js run
243243
const myBirthday = '18.04.1982';

1-js/02-first-steps/12-while-for/7-list-primes/solution.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ for (let i = 2; i <= n; i++) { // for each i...
2626
}
2727
```
2828

29-
There's a lot of space to opimize it. For instance, we could look for the divisors from `2` to square root of `i`. But anyway, if we want to be really efficient for large intervals, we need to change the approach and rely on advanced maths and complex algorithms like [Quadratic sieve](https://en.wikipedia.org/wiki/Quadratic_sieve), [General number field sieve](https://en.wikipedia.org/wiki/General_number_field_sieve) etc.
29+
There's a lot of space to optimize it. For instance, we could look for the divisors from `2` to square root of `i`. But anyway, if we want to be really efficient for large intervals, we need to change the approach and rely on advanced maths and complex algorithms like [Quadratic sieve](https://en.wikipedia.org/wiki/Quadratic_sieve), [General number field sieve](https://en.wikipedia.org/wiki/General_number_field_sieve) etc.

1-js/02-first-steps/15-function-expressions-arrows/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Please note that the last line does not run the function, because there are no p
4040

4141
In JavaScript, a function is a value, so we can deal with it as a value. The code above shows its string representation, which is the source code.
4242

43-
Surely, a function is a special values, in the sense that we can call it like `sayHi()`.
43+
Surely, a function is a special value, in the sense that we can call it like `sayHi()`.
4444

4545
But it's still a value. So we can work with it like with other kinds of values.
4646

1-js/04-object-basics/01-object/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -711,7 +711,7 @@ alert(clone.sizes.width); // 51, see the result from the other one
711711
712712
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".
713713
714-
There's a standard algorithm for deep cloning that handles the case above and more complex cases, called the [Structured cloning algorithm](http://w3c.github.io/html/infrastructure.html#safe-passing-of-structured-data). In order not to reinvent the wheel, we can use a working implementation of it from the JavaScript library [lodash](https://lodash.com), the method is called [_.cloneDeep(obj)](https://lodash.com/docs#cloneDeep).
714+
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). In order not to reinvent the wheel, we can use a working implementation of it from the JavaScript library [lodash](https://lodash.com), the method is called [_.cloneDeep(obj)](https://lodash.com/docs#cloneDeep).
715715
716716
717717

1-js/04-object-basics/04-object-methods/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ It's common that an object method needs to access the information stored in the
9898

9999
For instance, the code inside `user.sayHi()` may need the name of the `user`.
100100

101-
**To access the object, a method can use `this` keyword.**
101+
**To access the object, a method can use the `this` keyword.**
102102

103103
The value of `this` is the object "before dot", the one used to call the method.
104104

1-js/05-data-types/02-number/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ To write big numbers:
417417
For different numeral systems:
418418

419419
- Can write numbers directly in hex (`0x`), octal (`0o`) and binary (`0b`) systems
420-
- `parseInt(str, base)` parses an integer from any numeral system with base: `2 ≤ base ≤ 36`.
420+
- `parseInt(str, base)` parses the string `str` into an integer in numeral system with given `base`, `2 ≤ base ≤ 36`.
421421
- `num.toString(base)` converts a number to a string in the numeral system with the given `base`.
422422

423423
For converting values like `12pt` and `100px` to a number:

1-js/05-data-types/03-string/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ let guestList = "Guests: // Error: Unexpected token ILLEGAL
5050

5151
Single and double quotes come from ancient times of language creation when the need for multiline strings was not taken into account. Backticks appeared much later and thus are more versatile.
5252

53-
Backticks also allow us to specify a "template function" before the first backtick. The syntax is: <code>func&#96;string&#96;</code>. The function `func` is called automatically, receives the string and embedded expressions and can process them. You can read more about it in the [docs](mdn:/JavaScript/Reference/Template_literals#Tagged_templates). This is called "tagged templates". This feature makes it easier to wrap strings into custom templating or other functionality, but it is rarely used.
53+
Backticks also allow us to specify a "template function" before the first backtick. The syntax is: <code>func&#96;string&#96;</code>. The function `func` is called automatically, receives the string and embedded expressions and can process them. This is called "tagged templates". This feature makes it easier to implement custom templating, but is rarely used in practice. You can read more about it in the [manual](mdn:/JavaScript/Reference/Template_literals#Tagged_templates).
5454

5555
## Special characters
5656

1-js/05-data-types/05-array-methods/article.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ alert( arr.concat([3, 4], [5, 6])); // 1,2,3,4,5,6
169169
alert( arr.concat([3, 4], 5, 6)); // 1,2,3,4,5,6
170170
```
171171

172-
Normally, it only copies elements from arrays. Other objects, even if they look like arrays, added as a whole:
172+
Normally, it only copies elements from arrays. Other objects, even if they look like arrays, are added as a whole:
173173

174174
```js run
175175
let arr = [1, 2];
@@ -183,7 +183,7 @@ alert( arr.concat(arrayLike) ); // 1,2,[object Object]
183183
//[1, 2, arrayLike]
184184
```
185185

186-
...But if an array-like object has a special property `Symbol.isConcatSpreadable` property, the it's treated as array by `concat`: its elements are added instead:
186+
...But if an array-like object has a special `Symbol.isConcatSpreadable` property, then it's treated as an array by `concat`: its elements are added instead:
187187

188188
```js run
189189
let arr = [1, 2];

0 commit comments

Comments
 (0)