Skip to content

Commit 29ea890

Browse files
authored
Merge branch 'master' into patch-18
2 parents d0b95aa + c07eb5c commit 29ea890

File tree

17 files changed

+42
-43
lines changed

17 files changed

+42
-43
lines changed

1-js/04-object-basics/04-object-methods/3-why-this/task.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ importance: 3
44

55
# Explain the value of "this"
66

7-
In the code below we intend to call `user.go()` method 4 times in a row.
7+
In the code below we intend to call `obj.go()` method 4 times in a row.
88

99
But calls `(1)` and `(2)` works differently from `(3)` and `(4)`. Why?
1010

1-js/06-advanced-functions/08-settimeout-setinterval/article.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ For server-side JavaScript, that limitation does not exist, and there exist othe
288288

289289
- Methods `setTimeout(func, delay, ...args)` and `setInterval(func, delay, ...args)` allow us to run the `func` once/regularly after `delay` milliseconds.
290290
- To cancel the execution, we should call `clearTimeout/clearInterval` with the value returned by `setTimeout/setInterval`.
291-
- Nested `setTimeout` calls is a more flexible alternative to `setInterval`, allowing us to set the time *between* executions more precisely.
291+
- Nested `setTimeout` calls are a more flexible alternative to `setInterval`, allowing us to set the time *between* executions more precisely.
292292
- Zero delay scheduling with `setTimeout(func, 0)` (the same as `setTimeout(func)`) is used to schedule the call "as soon as possible, but after the current script is complete".
293293
- The browser limits the minimal delay for five or more nested call of `setTimeout` or for `setInterval` (after 5th call) to 4ms. That's for historical reasons.
294294

@@ -299,4 +299,4 @@ For example, the in-browser timer may slow down for a lot of reasons:
299299
- The browser tab is in the background mode.
300300
- The laptop is on battery.
301301

302-
All that may increase the minimal timer resolution (the minimal delay) to 300ms or even 1000ms depending on the browser and OS-level performance settings.
302+
All that may increase the minimal timer resolution (the minimal delay) by 300ms or even 1000ms depending on the browser and OS-level performance settings.

1-js/06-advanced-functions/10-bind/6-ask-partial/task.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ The task is a little more complex variant of <info:task/question-use-bind>.
88

99
The `user` object was modified. Now instead of two functions `loginOk/loginFail`, it has a single function `user.login(true/false)`.
1010

11-
What to pass `askPassword` in the code below, so that it calls `user.login(true)` as `ok` and `user.login(false)` as `fail`?
11+
What should we pass `askPassword` in the code below, so that it calls `user.login(true)` as `ok` and `user.login(false)` as `fail`?
1212

1313
```js
1414
function askPassword(ok, fail) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ Functions provide a built-in method [bind](mdn:js/Function/bind) that allows to
9898
The basic syntax is:
9999

100100
```js
101-
// more complex syntax will be little later
101+
// more complex syntax will come a little later
102102
let boundFunc = func.bind(context);
103103
```
104104

1-js/06-advanced-functions/12-arrow-functions/article.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,9 @@ Here we had to create additional variables `args` and `ctx` so that the function
118118

119119
Arrow functions:
120120

121-
- Do not have `this`.
122-
- Do not have `arguments`.
123-
- Can't be called with `new`.
124-
- (They also don't have `super`, but we didn't study it. Will be in the chapter <info:class-inheritance>).
121+
- Do not have `this`
122+
- Do not have `arguments`
123+
- Can't be called with `new`
124+
- They also don't have `super`, but we didn't study it yet. We will on the chapter <info:class-inheritance>
125125

126-
That's because they are meant for short pieces of code that do not have their own "context", but rather works in the current one. And they really shine in that use case.
126+
That's because they are meant for short pieces of code that do not have their own "context", but rather work in the current one. And they really shine in that use case.

1-js/07-object-properties/01-property-descriptors/article.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
As we know, objects can store properties.
55

6-
Till now, a property was a simple "key-value" pair to us. But an object property is actually a more flexible and powerful thing.
6+
Until now, a property was a simple "key-value" pair to us. But an object property is actually a more flexible and powerful thing.
77

88
In this chapter we'll study additional configuration options, and in the next we'll see how to invisibly turn them into getter/setter functions.
99

@@ -134,7 +134,7 @@ let user = { };
134134
Object.defineProperty(user, "name", {
135135
*!*
136136
value: "John",
137-
// for new properties need to explicitly list what's true
137+
// for new properties we need to explicitly list what's true
138138
enumerable: true,
139139
configurable: true
140140
*/!*
@@ -148,7 +148,7 @@ user.name = "Pete"; // Error
148148

149149
Now let's add a custom `toString` to `user`.
150150

151-
Normally, a built-in `toString` for objects is non-enumerable, it does not show up in `for..in`. But if we add `toString` of our own, then by default it shows up in `for..in`, like this:
151+
Normally, a built-in `toString` for objects is non-enumerable, it does not show up in `for..in`. But if we add a `toString` of our own, then by default it shows up in `for..in`, like this:
152152

153153
```js run
154154
let user = {
@@ -162,7 +162,7 @@ let user = {
162162
for (let key in user) alert(key); // name, toString
163163
```
164164

165-
If we don't like it, then we can set `enumerable:false`. Then it won't appear in `for..in` loop, just like the built-in one:
165+
If we don't like it, then we can set `enumerable:false`. Then it won't appear in a `for..in` loop, just like the built-in one:
166166

167167
```js run
168168
let user = {

1-js/07-object-properties/02-property-accessors/article.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
There are two kinds of properties.
55

6-
The first kind is *data properties*. We already know how to work with them. All properties that we've been using till now were data properties.
6+
The first kind is *data properties*. We already know how to work with them. All properties that we've been using until now were data properties.
77

88
The second type of properties is something new. It's *accessor properties*. They are essentially functions that work on getting and setting a value, but look like regular properties to an external code.
99

@@ -189,9 +189,9 @@ Technically, external code is able to access the name directly by using `user._n
189189

190190
## Using for compatibility
191191

192-
One of the great uses of accessors -- they allow to take control over a "regular" data property at any moment by replacing it with getter and setter and tweak its behavior.
192+
One of the great uses of accessors is that they allow to take control over a "regular" data property at any moment by replacing it with a getter and a setter and tweak its behavior.
193193

194-
Imagine, we started implementing user objects using data properties `name` and `age`:
194+
Imagine we started implementing user objects using data properties `name` and `age`:
195195

196196
```js
197197
function User(name, age) {

1-js/08-prototypes/01-prototype-inheritance/2-search-algorithm/task.md

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

77
The task has two parts.
88

9-
We have objects:
9+
Given the following objects:
1010

1111
```js
1212
let head = {

1-js/08-prototypes/01-prototype-inheritance/3-proto-and-this/task.md

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

33
---
44

5-
# Where it writes?
5+
# Where does it write?
66

77
We have `rabbit` inheriting from `animal`.
88

1-js/08-prototypes/01-prototype-inheritance/4-hamster-proto/task.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ importance: 5
22

33
---
44

5-
# Why two hamsters are full?
5+
# Why are both hamsters full?
66

77
We have two hamsters: `speedy` and `lazy` inheriting from the general `hamster` object.
88

9-
When we feed one of them, the other one is also full. Why? How to fix it?
9+
When we feed one of them, the other one is also full. Why? How can we fix it?
1010

1111
```js run
1212
let hamster = {

0 commit comments

Comments
 (0)