Skip to content

Commit 2b04aec

Browse files
committed
Merge branch 'master' of github.com:javascript-tutorial/en.javascript.info into sync-69893128
2 parents 97fd3dd + 6989312 commit 2b04aec

File tree

14 files changed

+46
-18
lines changed

14 files changed

+46
-18
lines changed

1-js/01-getting-started/1-intro/article.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ For instance, in-browser JavaScript is able to:
5959

6060
## What CAN'T in-browser JavaScript do?
6161

62-
JavaScript's abilities in the browser are limited for the sake of the user's safety. The aim is to prevent an evil webpage from accessing private information or harming the user's data.
62+
JavaScript's abilities in the browser are limited for the sake of a user's safety. The aim is to prevent an evil webpage from accessing private information or harming the user's data.
6363

6464
Examples of such restrictions include:
6565

@@ -86,7 +86,7 @@ There are at least *three* great things about JavaScript:
8686
```compare
8787
+ Full integration with HTML/CSS.
8888
+ Simple things are done simply.
89-
+ Support by all major browsers and enabled by default.
89+
+ Supported by all major browsers and enabled by default.
9090
```
9191
JavaScript is the only browser technology that combines these three things.
9292

@@ -118,5 +118,5 @@ There are more. Of course, even if we use one of transpiled languages, we should
118118
## Summary
119119

120120
- JavaScript was initially created as a browser-only language, but it is now used in many other environments as well.
121-
- Today, JavaScript has a unique position as the most widely-adopted browser language with full integration in HTML/CSS.
121+
- Today, JavaScript has a unique position as the most widely-adopted browser language, fully integrated with HTML/CSS.
122122
- There are many languages that get "transpiled" to JavaScript and provide certain features. It is recommended to take a look at them, at least briefly, after mastering JavaScript.

1-js/06-advanced-functions/03-closure/9-sort-by-field/_js.view/test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ describe("byField", function(){
2323
{ name: "John", age: 20, surname: "Johnson"},
2424
];
2525
let ageSortedAnswer = users.sort(byField("age"));
26-
assert.deepEqual(ageSortedKey, ageSortedKey);
26+
assert.deepEqual(ageSortedKey, ageSortedAnswer);
2727
});
2828

2929
it("sorts users by surname", function(){

1-js/06-advanced-functions/10-bind/article.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,8 +187,8 @@ let user = {
187187

188188
let say = user.say.bind(user);
189189

190-
say("Hello"); // Hello, John ("Hello" argument is passed to say)
191-
say("Bye"); // Bye, John ("Bye" is passed to say)
190+
say("Hello"); // Hello, John! ("Hello" argument is passed to say)
191+
say("Bye"); // Bye, John! ("Bye" is passed to say)
192192
```
193193

194194
````smart header="Convenience method: `bindAll`"

1-js/09-classes/06-instanceof/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ The algorithm of `obj instanceof Class` works roughly as follows:
9393
alert(rabbit instanceof Animal); // true
9494
*/!*
9595
96-
// rabbit.__proto__ === Rabbit.prototype
96+
// rabbit.__proto__ === Animal.prototype (no match)
9797
*!*
9898
// rabbit.__proto__.__proto__ === Animal.prototype (match!)
9999
*/!*

1-js/11-async/03-promise-chaining/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ The idea is that the result is passed through the chain of `.then` handlers.
3737
Here the flow is:
3838
1. The initial promise resolves in 1 second `(*)`,
3939
2. Then the `.then` handler is called `(**)`, which in turn creates a new promise (resolved with `2` value).
40-
3. The next `then` `(***)` gets the result of the previous one, processes it (doubles) and passes the next handler.
40+
3. The next `then` `(***)` gets the result of the previous one, processes it (doubles) and passes it to the next handler.
4141
4. ...and so on.
4242

4343
As the result is passed along the chain of handlers, we can see a sequence of `alert` calls: `1` -> `2` -> `4`.

1-js/11-async/08-async-await/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ The `async` keyword before a function has two effects:
303303
304304
The `await` keyword before a promise makes JavaScript wait until that promise settles, and then:
305305
306-
1. If it's an error, the exception is generated — same as if `throw error` were called at that very place.
306+
1. If it's an error, an exception is generated — same as if `throw error` were called at that very place.
307307
2. Otherwise, it returns the result.
308308
309309
Together they provide a great framework to write asynchronous code that is easy to both read and write.

1-js/13-modules/01-modules-intro/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ Compare it to non-module scripts, where `this` is a global object:
261261
262262
There are also several browser-specific differences of scripts with `type="module"` compared to regular ones.
263263
264-
You may want skip this section for now if you're reading for the first time, or if you don't use JavaScript in a browser.
264+
You may want to skip this section for now if you're reading for the first time, or if you don't use JavaScript in a browser.
265265
266266
### Module scripts are deferred
267267

2-ui/1-document/05-basic-dom-node-properties/article.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ The classes are:
2525
- [HTMLInputElement](https://html.spec.whatwg.org/multipage/forms.html#htmlinputelement) -- the class for `<input>` elements,
2626
- [HTMLBodyElement](https://html.spec.whatwg.org/multipage/semantics.html#htmlbodyelement) -- the class for `<body>` elements,
2727
- [HTMLAnchorElement](https://html.spec.whatwg.org/multipage/semantics.html#htmlanchorelement) -- the class for `<a>` elements,
28-
- ...and so on, each tag has its own class that may provide specific properties and methods.
28+
- ...and so on.
29+
30+
There are many other tags with their own classes that may specific properties and methods, while some elements, such as `<span>`, `<section>`, `<article>` do not have any specific properties, so they are instances of `HTMLElement` class.
2931

3032
So, the full set of properties and methods of a given node comes as the result of the inheritance.
3133

@@ -128,7 +130,7 @@ For instance:
128130
129131
```html run
130132
<body>
131-
<script>
133+
<script>
132134
let elem = document.body;
133135
134136
// let's examine what it is?

2-ui/1-document/09-size-and-scroll/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ function isHidden(elem) {
116116
}
117117
```
118118
119-
Please note that such `isHidden` returns `true` for elements that are on-screen, but have zero sizes (like an empty `<div>`).
119+
Please note that such `isHidden` returns `true` for elements that are on-screen, but have zero sizes.
120120
````
121121

122122
## clientTop/Left

2-ui/2-events/01-introduction-browser-events/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ button.onclick = sayThanks;
160160
button.onclick = sayThanks();
161161
```
162162

163-
If we add parentheses, then `sayThanks()` becomes is a function call. So the last line actually takes the *result* of the function execution, that is `undefined` (as the function returns nothing), and assigns it to `onclick`. That doesn't work.
163+
If we add parentheses, then `sayThanks()` becomes a function call. So the last line actually takes the *result* of the function execution, that is `undefined` (as the function returns nothing), and assigns it to `onclick`. That doesn't work.
164164

165165
...On the other hand, in the markup we do need the parentheses:
166166

0 commit comments

Comments
 (0)