From da8af69e01029ee3bfb3db2089839d56e2c86670 Mon Sep 17 00:00:00 2001
From: hrodward <2536699+hrodward@users.noreply.github.com>
Date: Thu, 17 Oct 2019 13:56:11 +0200
Subject: [PATCH 01/24] Update article.md
Grammar fixes
---
.../08-settimeout-setinterval/article.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/1-js/06-advanced-functions/08-settimeout-setinterval/article.md b/1-js/06-advanced-functions/08-settimeout-setinterval/article.md
index eb88c56a..c2d8bd38 100644
--- a/1-js/06-advanced-functions/08-settimeout-setinterval/article.md
+++ b/1-js/06-advanced-functions/08-settimeout-setinterval/article.md
@@ -288,7 +288,7 @@ For server-side JavaScript, that limitation does not exist, and there exist othe
- Methods `setTimeout(func, delay, ...args)` and `setInterval(func, delay, ...args)` allow us to run the `func` once/regularly after `delay` milliseconds.
- To cancel the execution, we should call `clearTimeout/clearInterval` with the value returned by `setTimeout/setInterval`.
-- Nested `setTimeout` calls is a more flexible alternative to `setInterval`, allowing us to set the time *between* executions more precisely.
+- Nested `setTimeout` calls are a more flexible alternative to `setInterval`, allowing us to set the time *between* executions more precisely.
- 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".
- 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.
@@ -299,4 +299,4 @@ For example, the in-browser timer may slow down for a lot of reasons:
- The browser tab is in the background mode.
- The laptop is on battery.
-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.
+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.
From 5b795f776e130ae19e7afebe9a2f376949c2b679 Mon Sep 17 00:00:00 2001
From: Ghost-017 <31908292+Ghost-017@users.noreply.github.com>
Date: Sat, 19 Oct 2019 19:54:24 +0800
Subject: [PATCH 02/24] minor
---
2-ui/5-loading/02-script-async-defer/article.md | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/2-ui/5-loading/02-script-async-defer/article.md b/2-ui/5-loading/02-script-async-defer/article.md
index e7f898f2..ade6c0c7 100644
--- a/2-ui/5-loading/02-script-async-defer/article.md
+++ b/2-ui/5-loading/02-script-async-defer/article.md
@@ -3,11 +3,11 @@
In modern websites, scripts are often "heavier" than HTML: their download size is larger, and processing time is also longer.
-When the browser loads HTML and comes across a `` tag, it can't continue building DOM. It must execute the script right now. The same happens for external scripts ``: the browser must wait until the script downloads, execute it, and only after process the rest of the page.
+When the browser loads HTML and comes across a `` tag, it can't continue building the DOM. It must execute the script right now. The same happens for external scripts ``: the browser must wait until the script downloads, execute it, and only after process the rest of the page.
That leads to two important issues:
-1. Scripts can't see DOM elements below them, so can't add handlers etc.
+1. Scripts can't see DOM elements below them, so it can't add handlers etc.
2. If there's a bulky script at the top of the page, it "blocks the page". Users can't see the page content till it downloads and runs:
```html run height=100
@@ -31,7 +31,7 @@ There are some workarounds to that. For instance, we can put a script at the bot
But this solution is far from perfect. For example, the browser notices the script (and can start downloading it) only after it downloaded the full HTML document. For long HTML documents, that may be a noticeable delay.
-Such things are invisible for people using very fast connections, but many people in the world still have slower internet speeds and use far-from-perfect mobile internet.
+Such things are invisible for people using very fast connections, but many people in the world still have slow internet speeds and use far-from-perfect mobile internet.
Luckily, there are two `` tag, it ca
That leads to two important issues:
-1. Scripts can't see DOM elements below them, so it can't add handlers etc.
+1. Scripts can't see DOM elements below them, so they can't add handlers etc.
2. If there's a bulky script at the top of the page, it "blocks the page". Users can't see the page content till it downloads and runs:
```html run height=100
From 74ad826d0d703d00f91324d70e30772b288a75a8 Mon Sep 17 00:00:00 2001
From: hrodward <2536699+hrodward@users.noreply.github.com>
Date: Mon, 21 Oct 2019 08:09:39 +0200
Subject: [PATCH 05/24] Update article.md
Grammar
---
1-js/06-advanced-functions/10-bind/article.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/1-js/06-advanced-functions/10-bind/article.md b/1-js/06-advanced-functions/10-bind/article.md
index b8c545b1..20f2e098 100644
--- a/1-js/06-advanced-functions/10-bind/article.md
+++ b/1-js/06-advanced-functions/10-bind/article.md
@@ -98,7 +98,7 @@ Functions provide a built-in method [bind](mdn:js/Function/bind) that allows to
The basic syntax is:
```js
-// more complex syntax will be little later
+// more complex syntax will come a little later
let boundFunc = func.bind(context);
```
From cc3c01bd9470cec24fc394fb40dfe66001702330 Mon Sep 17 00:00:00 2001
From: hrodward <2536699+hrodward@users.noreply.github.com>
Date: Mon, 21 Oct 2019 08:30:26 +0200
Subject: [PATCH 06/24] Update task.md
Grammar
---
1-js/06-advanced-functions/10-bind/6-ask-partial/task.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/1-js/06-advanced-functions/10-bind/6-ask-partial/task.md b/1-js/06-advanced-functions/10-bind/6-ask-partial/task.md
index f8b83d7a..c90851c2 100644
--- a/1-js/06-advanced-functions/10-bind/6-ask-partial/task.md
+++ b/1-js/06-advanced-functions/10-bind/6-ask-partial/task.md
@@ -8,7 +8,7 @@ The task is a little more complex variant of .
The `user` object was modified. Now instead of two functions `loginOk/loginFail`, it has a single function `user.login(true/false)`.
-What to pass `askPassword` in the code below, so that it calls `user.login(true)` as `ok` and `user.login(false)` as `fail`?
+What should we pass `askPassword` in the code below, so that it calls `user.login(true)` as `ok` and `user.login(false)` as `fail`?
```js
function askPassword(ok, fail) {
From cd97f84c94c274682075f85fa330f5d51526d31f Mon Sep 17 00:00:00 2001
From: hrodward <2536699+hrodward@users.noreply.github.com>
Date: Mon, 21 Oct 2019 08:49:55 +0200
Subject: [PATCH 07/24] Update article.md
Grammar
---
.../12-arrow-functions/article.md | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/1-js/06-advanced-functions/12-arrow-functions/article.md b/1-js/06-advanced-functions/12-arrow-functions/article.md
index 1d6b0439..f5caeaec 100644
--- a/1-js/06-advanced-functions/12-arrow-functions/article.md
+++ b/1-js/06-advanced-functions/12-arrow-functions/article.md
@@ -118,9 +118,9 @@ Here we had to create additional variables `args` and `ctx` so that the function
Arrow functions:
-- Do not have `this`.
-- Do not have `arguments`.
-- Can't be called with `new`.
-- (They also don't have `super`, but we didn't study it. Will be in the chapter ).
+- Do not have `this`
+- Do not have `arguments`
+- Can't be called with `new`
+- They also don't have `super`, but we didn't study it yet. We will on the chapter
-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.
+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.
From 5c6be4c8bcc235c1e988987203ed326a3bbc2ee2 Mon Sep 17 00:00:00 2001
From: hrodward <2536699+hrodward@users.noreply.github.com>
Date: Mon, 21 Oct 2019 10:50:02 +0200
Subject: [PATCH 08/24] Update article.md
Grammar
---
.../01-property-descriptors/article.md | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/1-js/07-object-properties/01-property-descriptors/article.md b/1-js/07-object-properties/01-property-descriptors/article.md
index 9f8f85d9..e894f066 100644
--- a/1-js/07-object-properties/01-property-descriptors/article.md
+++ b/1-js/07-object-properties/01-property-descriptors/article.md
@@ -3,7 +3,7 @@
As we know, objects can store properties.
-Till now, a property was a simple "key-value" pair to us. But an object property is actually a more flexible and powerful thing.
+Until now, a property was a simple "key-value" pair to us. But an object property is actually a more flexible and powerful thing.
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.
@@ -134,7 +134,7 @@ let user = { };
Object.defineProperty(user, "name", {
*!*
value: "John",
- // for new properties need to explicitly list what's true
+ // for new properties we need to explicitly list what's true
enumerable: true,
configurable: true
*/!*
@@ -148,7 +148,7 @@ user.name = "Pete"; // Error
Now let's add a custom `toString` to `user`.
-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:
+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:
```js run
let user = {
@@ -162,7 +162,7 @@ let user = {
for (let key in user) alert(key); // name, toString
```
-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:
+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:
```js run
let user = {
From 8c1b7674628ed9a977e57cc4adbdff349031dc6b Mon Sep 17 00:00:00 2001
From: hrodward <2536699+hrodward@users.noreply.github.com>
Date: Mon, 21 Oct 2019 11:03:10 +0200
Subject: [PATCH 09/24] Update article.md
Grammar
---
1-js/07-object-properties/02-property-accessors/article.md | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/1-js/07-object-properties/02-property-accessors/article.md b/1-js/07-object-properties/02-property-accessors/article.md
index dc541b6d..726529c5 100644
--- a/1-js/07-object-properties/02-property-accessors/article.md
+++ b/1-js/07-object-properties/02-property-accessors/article.md
@@ -3,7 +3,7 @@
There are two kinds of properties.
-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.
+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.
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.
@@ -189,9 +189,9 @@ Technically, external code is able to access the name directly by using `user._n
## Using for compatibility
-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.
+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.
-Imagine, we started implementing user objects using data properties `name` and `age`:
+Imagine we started implementing user objects using data properties `name` and `age`:
```js
function User(name, age) {
From 906dd131f18a5cc80394d54b4f7e561c36afe7b0 Mon Sep 17 00:00:00 2001
From: hrodward <2536699+hrodward@users.noreply.github.com>
Date: Mon, 21 Oct 2019 11:43:39 +0200
Subject: [PATCH 10/24] Update task.md
Grammar
---
.../01-prototype-inheritance/2-search-algorithm/task.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/1-js/08-prototypes/01-prototype-inheritance/2-search-algorithm/task.md b/1-js/08-prototypes/01-prototype-inheritance/2-search-algorithm/task.md
index 421b57e0..bc2db47f 100644
--- a/1-js/08-prototypes/01-prototype-inheritance/2-search-algorithm/task.md
+++ b/1-js/08-prototypes/01-prototype-inheritance/2-search-algorithm/task.md
@@ -6,7 +6,7 @@ importance: 5
The task has two parts.
-We have objects:
+Given the following objects:
```js
let head = {
From 750089846745f32200be429ee6c817e7c910c250 Mon Sep 17 00:00:00 2001
From: hrodward <2536699+hrodward@users.noreply.github.com>
Date: Mon, 21 Oct 2019 11:48:46 +0200
Subject: [PATCH 11/24] Update task.md
Grammar
---
.../01-prototype-inheritance/3-proto-and-this/task.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/1-js/08-prototypes/01-prototype-inheritance/3-proto-and-this/task.md b/1-js/08-prototypes/01-prototype-inheritance/3-proto-and-this/task.md
index b37499ba..ed8482c0 100644
--- a/1-js/08-prototypes/01-prototype-inheritance/3-proto-and-this/task.md
+++ b/1-js/08-prototypes/01-prototype-inheritance/3-proto-and-this/task.md
@@ -2,7 +2,7 @@ importance: 5
---
-# Where it writes?
+# Where does it write?
We have `rabbit` inheriting from `animal`.
From c0fd76be3dd8f170f4db9872172d83c53a6be06d Mon Sep 17 00:00:00 2001
From: hrodward <2536699+hrodward@users.noreply.github.com>
Date: Mon, 21 Oct 2019 11:52:48 +0200
Subject: [PATCH 12/24] Update task.md
Grammar
---
.../01-prototype-inheritance/4-hamster-proto/task.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/1-js/08-prototypes/01-prototype-inheritance/4-hamster-proto/task.md b/1-js/08-prototypes/01-prototype-inheritance/4-hamster-proto/task.md
index 6f9fb279..50171123 100644
--- a/1-js/08-prototypes/01-prototype-inheritance/4-hamster-proto/task.md
+++ b/1-js/08-prototypes/01-prototype-inheritance/4-hamster-proto/task.md
@@ -2,11 +2,11 @@ importance: 5
---
-# Why two hamsters are full?
+# Why are both hamsters full?
We have two hamsters: `speedy` and `lazy` inheriting from the general `hamster` object.
-When we feed one of them, the other one is also full. Why? How to fix it?
+When we feed one of them, the other one is also full. Why? How can we fix it?
```js run
let hamster = {
From 89c4a0fca9fa9e92ad6a607f14779d0128f10593 Mon Sep 17 00:00:00 2001
From: hrodward <2536699+hrodward@users.noreply.github.com>
Date: Mon, 21 Oct 2019 12:26:24 +0200
Subject: [PATCH 13/24] Update article.md
Grammar
---
1-js/08-prototypes/02-function-prototype/article.md | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/1-js/08-prototypes/02-function-prototype/article.md b/1-js/08-prototypes/02-function-prototype/article.md
index 29b3773e..c106d1d9 100644
--- a/1-js/08-prototypes/02-function-prototype/article.md
+++ b/1-js/08-prototypes/02-function-prototype/article.md
@@ -2,7 +2,7 @@
Remember, new objects can be created with a constructor function, like `new F()`.
-If `F.prototype` is an object, then `new` operator uses it to set `[[Prototype]]` for the new object.
+If `F.prototype` is an object, then the `new` operator uses it to set `[[Prototype]]` for the new object.
```smart
JavaScript had prototypal inheritance from the beginning. It was one of the core features of the language.
@@ -158,9 +158,9 @@ Rabbit.prototype = {
In this chapter we briefly described the way of setting a `[[Prototype]]` for objects created via a constructor function. Later we'll see more advanced programming patterns that rely on it.
-Everything is quite simple, just few notes to make things clear:
+Everything is quite simple, just a few notes to make things clear:
-- The `F.prototype` property (don't mess with `[[Prototype]]`) sets `[[Prototype]]` of new objects when `new F()` is called.
+- The `F.prototype` property (don't mistake it for `[[Prototype]]`) sets `[[Prototype]]` of new objects when `new F()` is called.
- The value of `F.prototype` should be either an object or `null`: other values won't work.
- The `"prototype"` property only has such a special effect when set on a constructor function, and invoked with `new`.
From 4bb52fb04634163137dc5708281a27fa78ff9d9e Mon Sep 17 00:00:00 2001
From: hrodward <2536699+hrodward@users.noreply.github.com>
Date: Mon, 21 Oct 2019 13:46:15 +0200
Subject: [PATCH 14/24] Update task.md
Grammar
---
.../02-function-prototype/1-changing-prototype/task.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/1-js/08-prototypes/02-function-prototype/1-changing-prototype/task.md b/1-js/08-prototypes/02-function-prototype/1-changing-prototype/task.md
index 4b8522d3..2838c125 100644
--- a/1-js/08-prototypes/02-function-prototype/1-changing-prototype/task.md
+++ b/1-js/08-prototypes/02-function-prototype/1-changing-prototype/task.md
@@ -20,7 +20,7 @@ alert( rabbit.eats ); // true
```
-1. We added one more string (emphasized), what `alert` shows now?
+1. We added one more string (emphasized). What will `alert` show now?
```js
function Rabbit() {}
@@ -54,7 +54,7 @@ alert( rabbit.eats ); // true
alert( rabbit.eats ); // ?
```
-3. Like this (replaced one line)?
+3. And like this (replaced one line)?
```js
function Rabbit() {}
From 2cbed98e58711e0c17b8a9eae7468136abc41c98 Mon Sep 17 00:00:00 2001
From: Ilya Kantor
Date: Mon, 21 Oct 2019 16:15:04 +0300
Subject: [PATCH 15/24] minor
---
2-ui/5-loading/02-script-async-defer/article.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/2-ui/5-loading/02-script-async-defer/article.md b/2-ui/5-loading/02-script-async-defer/article.md
index a0c91fec..c627c42a 100644
--- a/2-ui/5-loading/02-script-async-defer/article.md
+++ b/2-ui/5-loading/02-script-async-defer/article.md
@@ -191,7 +191,7 @@ Please note that if you're using `defer`, then the page is visible *before* the
So the user may read the page, but some graphical components are probably not ready yet.
-There should be "loading" indications in proper places, set not-working buttons to disabled, to clearly show the user what's ready and what's not.
+There should be "loading" indications in proper places, and not-working buttons should be visually disabled, to clearly show the user what's ready and what's not.
```
In practice, `defer` is used for scripts that need the whole DOM and/or their relative execution order is important. And `async` is used for independent scripts, like counters or ads. And their relative execution order does not matter.
From 7a6a56601eae1c2d3f5749bbc79e2ab4f7a04d42 Mon Sep 17 00:00:00 2001
From: Ilya Kantor
Date: Mon, 21 Oct 2019 16:21:13 +0300
Subject: [PATCH 16/24] minor
---
9-regular-expressions/10-regexp-greedy-and-lazy/article.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/9-regular-expressions/10-regexp-greedy-and-lazy/article.md b/9-regular-expressions/10-regexp-greedy-and-lazy/article.md
index 4298e7c8..79abc559 100644
--- a/9-regular-expressions/10-regexp-greedy-and-lazy/article.md
+++ b/9-regular-expressions/10-regexp-greedy-and-lazy/article.md
@@ -140,7 +140,7 @@ To clearly understand the change, let's trace the search step by step.

-In this example we saw how the lazy mode works for `pattern:+?`. Quantifiers `pattern:+?` and `pattern:??` work the similar way -- the regexp engine increases the number of repetitions only if the rest of the pattern can't match on the given position.
+In this example we saw how the lazy mode works for `pattern:+?`. Quantifiers `pattern:*?` and `pattern:??` work the similar way -- the regexp engine increases the number of repetitions only if the rest of the pattern can't match on the given position.
**Laziness is only enabled for the quantifier with `?`.**
From 09d2e96c515ea89458952bf537cadf16211b5d8c Mon Sep 17 00:00:00 2001
From: paroche <46547072+paroche@users.noreply.github.com>
Date: Mon, 21 Oct 2019 14:01:56 -0600
Subject: [PATCH 17/24] Update article.md
Sp., small change(s). Looks like someone else fixed main problem w/ "There should be..." sentence before I got here :-)
---
2-ui/5-loading/02-script-async-defer/article.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/2-ui/5-loading/02-script-async-defer/article.md b/2-ui/5-loading/02-script-async-defer/article.md
index c627c42a..95e31d17 100644
--- a/2-ui/5-loading/02-script-async-defer/article.md
+++ b/2-ui/5-loading/02-script-async-defer/article.md
@@ -31,7 +31,7 @@ There are some workarounds to that. For instance, we can put a script at the bot
But this solution is far from perfect. For example, the browser notices the script (and can start downloading it) only after it downloaded the full HTML document. For long HTML documents, that may be a noticeable delay.
-Such things are invisible for people using very fast connections, but many people in the world still have slow internet speeds and use a far-from-perfect mobile internet connecion.
+Such things are invisible for people using very fast connections, but many people in the world still have slow internet speeds and use a far-from-perfect mobile internet connection.
Luckily, there are two `