You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 1-js/06-advanced-functions/08-settimeout-setinterval/article.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -288,7 +288,7 @@ For server-side JavaScript, that limitation does not exist, and there exist othe
288
288
289
289
- Methods `setTimeout(func, delay, ...args)` and `setInterval(func, delay, ...args)` allow us to run the `func` once/regularly after `delay` milliseconds.
290
290
- 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.
292
292
- 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".
293
293
- 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.
Copy file name to clipboardExpand all lines: 1-js/06-advanced-functions/12-arrow-functions/article.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -118,9 +118,9 @@ Here we had to create additional variables `args` and `ctx` so that the function
118
118
119
119
Arrow functions:
120
120
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>
125
125
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.
Copy file name to clipboardExpand all lines: 1-js/07-object-properties/01-property-descriptors/article.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@
3
3
4
4
As we know, objects can store properties.
5
5
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.
7
7
8
8
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.
9
9
@@ -134,7 +134,7 @@ let user = { };
134
134
Object.defineProperty(user, "name", {
135
135
*!*
136
136
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
138
138
enumerable:true,
139
139
configurable:true
140
140
*/!*
@@ -148,7 +148,7 @@ user.name = "Pete"; // Error
148
148
149
149
Now let's add a custom `toString` to `user`.
150
150
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:
152
152
153
153
```js run
154
154
let user = {
@@ -162,7 +162,7 @@ let user = {
162
162
for (let key in user) alert(key); // name, toString
163
163
```
164
164
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:
Copy file name to clipboardExpand all lines: 1-js/07-object-properties/02-property-accessors/article.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@
3
3
4
4
There are two kinds of properties.
5
5
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.
7
7
8
8
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.
9
9
@@ -189,9 +189,9 @@ Technically, external code is able to access the name directly by using `user._n
189
189
190
190
## Using for compatibility
191
191
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.
193
193
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`:
0 commit comments