From e3b10e61856b0539390f2503913d200f84a13da5 Mon Sep 17 00:00:00 2001 From: Kevin Jones Date: Sun, 10 Oct 2021 16:37:38 -0500 Subject: [PATCH 01/25] sort-by-field fix --- .../03-closure/9-sort-by-field/_js.view/test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/1-js/06-advanced-functions/03-closure/9-sort-by-field/_js.view/test.js b/1-js/06-advanced-functions/03-closure/9-sort-by-field/_js.view/test.js index e3c335e03..802f28c4d 100644 --- a/1-js/06-advanced-functions/03-closure/9-sort-by-field/_js.view/test.js +++ b/1-js/06-advanced-functions/03-closure/9-sort-by-field/_js.view/test.js @@ -23,7 +23,7 @@ describe("byField", function(){ { name: "John", age: 20, surname: "Johnson"}, ]; let ageSortedAnswer = users.sort(byField("age")); - assert.deepEqual(ageSortedKey, ageSortedKey); + assert.deepEqual(ageSortedKey, ageSortedAnswer); }); it("sorts users by surname", function(){ From 91a89eac20095b983f369b5b63e5ab3b49a6f047 Mon Sep 17 00:00:00 2001 From: LexaWin <87317612+LexaWin@users.noreply.github.com> Date: Mon, 11 Oct 2021 21:32:36 +0300 Subject: [PATCH 02/25] Update article.md instanceof is only looking for Animal.prototype in the prototype chain, don't Rabbit.prototype --- 1-js/09-classes/06-instanceof/article.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/1-js/09-classes/06-instanceof/article.md b/1-js/09-classes/06-instanceof/article.md index 630818188..f9db989ca 100644 --- a/1-js/09-classes/06-instanceof/article.md +++ b/1-js/09-classes/06-instanceof/article.md @@ -93,7 +93,7 @@ The algorithm of `obj instanceof Class` works roughly as follows: alert(rabbit instanceof Animal); // true */!* - // rabbit.__proto__ === Rabbit.prototype + // rabbit.__proto__ === Animal.prototype (no match) *!* // rabbit.__proto__.__proto__ === Animal.prototype (match!) */!* From 4397c7f931ea7e760ebb8e0b90462624e075829c Mon Sep 17 00:00:00 2001 From: Jiapan-Yu <2541771811yjp@gmail.com> Date: Thu, 21 Oct 2021 16:33:44 +0800 Subject: [PATCH 03/25] not a right comparison an empty
has its parent element's content area width which may not be zero --- 2-ui/1-document/09-size-and-scroll/article.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/2-ui/1-document/09-size-and-scroll/article.md b/2-ui/1-document/09-size-and-scroll/article.md index 13e245ebb..b477a2811 100644 --- a/2-ui/1-document/09-size-and-scroll/article.md +++ b/2-ui/1-document/09-size-and-scroll/article.md @@ -116,7 +116,7 @@ function isHidden(elem) { } ``` -Please note that such `isHidden` returns `true` for elements that are on-screen, but have zero sizes (like an empty `
`). +Please note that such `isHidden` returns `true` for elements that are on-screen, but have zero sizes. ```` ## clientTop/Left From c20baa70ce015213b3a18441670d6c0ef0e68893 Mon Sep 17 00:00:00 2001 From: MaHdi Date: Thu, 21 Oct 2021 12:53:20 +0330 Subject: [PATCH 04/25] Add missing "!" --- 1-js/06-advanced-functions/10-bind/article.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/1-js/06-advanced-functions/10-bind/article.md b/1-js/06-advanced-functions/10-bind/article.md index 3cee4fe83..9d705cdcd 100644 --- a/1-js/06-advanced-functions/10-bind/article.md +++ b/1-js/06-advanced-functions/10-bind/article.md @@ -187,8 +187,8 @@ let user = { let say = user.say.bind(user); -say("Hello"); // Hello, John ("Hello" argument is passed to say) -say("Bye"); // Bye, John ("Bye" is passed to say) +say("Hello"); // Hello, John! ("Hello" argument is passed to say) +say("Bye"); // Bye, John! ("Bye" is passed to say) ``` ````smart header="Convenience method: `bindAll`" From db074cd4c6b4dccf78d2f222ab4ea56adc9901f9 Mon Sep 17 00:00:00 2001 From: Vigu Date: Fri, 22 Oct 2021 06:40:40 +0200 Subject: [PATCH 05/25] Remove redundant word in Possible Mistakes section --- 2-ui/2-events/01-introduction-browser-events/article.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/2-ui/2-events/01-introduction-browser-events/article.md b/2-ui/2-events/01-introduction-browser-events/article.md index 19394e49e..f75f6c11f 100644 --- a/2-ui/2-events/01-introduction-browser-events/article.md +++ b/2-ui/2-events/01-introduction-browser-events/article.md @@ -160,7 +160,7 @@ button.onclick = sayThanks; button.onclick = sayThanks(); ``` -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. +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. ...On the other hand, in the markup we do need the parentheses: From e0624c31db20128f851e0da821808c29ebebb7ec Mon Sep 17 00:00:00 2001 From: Nee <20254688+dneey@users.noreply.github.com> Date: Fri, 22 Oct 2021 18:49:09 +0000 Subject: [PATCH 06/25] Update article.md --- 1-js/13-modules/01-modules-intro/article.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/1-js/13-modules/01-modules-intro/article.md b/1-js/13-modules/01-modules-intro/article.md index 7dc65a769..6568c06f1 100644 --- a/1-js/13-modules/01-modules-intro/article.md +++ b/1-js/13-modules/01-modules-intro/article.md @@ -261,7 +261,7 @@ Compare it to non-module scripts, where `this` is a global object: There are also several browser-specific differences of scripts with `type="module"` compared to regular ones. -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. +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. ### Module scripts are deferred From 1310d542ff32e3379736bec2b56bc8db88d15863 Mon Sep 17 00:00:00 2001 From: Kenneth Lum Date: Sat, 23 Oct 2021 15:59:44 -0700 Subject: [PATCH 07/25] fix typo --- 1-js/11-async/08-async-await/article.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/1-js/11-async/08-async-await/article.md b/1-js/11-async/08-async-await/article.md index de965d48d..48e72a358 100644 --- a/1-js/11-async/08-async-await/article.md +++ b/1-js/11-async/08-async-await/article.md @@ -298,7 +298,7 @@ The `async` keyword before a function has two effects: The `await` keyword before a promise makes JavaScript wait until that promise settles, and then: -1. If it's an error, the exception is generated — same as if `throw error` were called at that very place. +1. If it's an error, an exception is generated — same as if `throw error` were called at that very place. 2. Otherwise, it returns the result. Together they provide a great framework to write asynchronous code that is easy to both read and write. From 4c2658d60d60e2958d6300830f08419ed5cd6f33 Mon Sep 17 00:00:00 2001 From: Zuhaib Shah <34958019+zaibugemi@users.noreply.github.com> Date: Sun, 24 Oct 2021 13:26:12 +0500 Subject: [PATCH 08/25] Fixed a grammatical error --- 1-js/11-async/03-promise-chaining/article.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/1-js/11-async/03-promise-chaining/article.md b/1-js/11-async/03-promise-chaining/article.md index f675d72ec..6da4cb02e 100644 --- a/1-js/11-async/03-promise-chaining/article.md +++ b/1-js/11-async/03-promise-chaining/article.md @@ -37,7 +37,7 @@ The idea is that the result is passed through the chain of `.then` handlers. Here the flow is: 1. The initial promise resolves in 1 second `(*)`, 2. Then the `.then` handler is called `(**)`, which in turn creates a new promise (resolved with `2` value). -3. The next `then` `(***)` gets the result of the previous one, processes it (doubles) and passes the next handler. +3. The next `then` `(***)` gets the result of the previous one, processes it (doubles) and passes it to the next handler. 4. ...and so on. As the result is passed along the chain of handlers, we can see a sequence of `alert` calls: `1` -> `2` -> `4`. From 2a5c881911cb9bb69db25da5bfabe5b9c8d64398 Mon Sep 17 00:00:00 2001 From: Ilya Kantor Date: Mon, 25 Oct 2021 22:16:15 +0300 Subject: [PATCH 09/25] minor fixes --- 1-js/01-getting-started/1-intro/article.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/1-js/01-getting-started/1-intro/article.md b/1-js/01-getting-started/1-intro/article.md index f8dc45ea6..ff7db2f5c 100644 --- a/1-js/01-getting-started/1-intro/article.md +++ b/1-js/01-getting-started/1-intro/article.md @@ -59,7 +59,7 @@ For instance, in-browser JavaScript is able to: ## What CAN'T in-browser JavaScript do? -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. +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. Examples of such restrictions include: @@ -86,7 +86,7 @@ There are at least *three* great things about JavaScript: ```compare + Full integration with HTML/CSS. + Simple things are done simply. -+ Support by all major browsers and enabled by default. ++ Supported by all major browsers and enabled by default. ``` JavaScript is the only browser technology that combines these three things. @@ -118,5 +118,5 @@ There are more. Of course, even if we use one of transpiled languages, we should ## Summary - JavaScript was initially created as a browser-only language, but it is now used in many other environments as well. -- Today, JavaScript has a unique position as the most widely-adopted browser language with full integration in HTML/CSS. +- Today, JavaScript has a unique position as the most widely-adopted browser language, fully integrated with HTML/CSS. - 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. From 9dc5f3e949fd320121e5bb7f7ce259ed74f3c36d Mon Sep 17 00:00:00 2001 From: Ilya Kantor Date: Mon, 25 Oct 2021 22:24:10 +0300 Subject: [PATCH 10/25] minor fixes --- 2-ui/5-loading/02-script-async-defer/article.md | 8 ++++++-- 1 file changed, 6 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 22497e207..f97c000d6 100644 --- a/2-ui/5-loading/02-script-async-defer/article.md +++ b/2-ui/5-loading/02-script-async-defer/article.md @@ -133,8 +133,12 @@ Async scripts are great when we integrate an independent third-party script into ``` +```smart header="The `async` attribute is only for external scripts" +Just like `defer`, the `async` attribute is ignored if the ` ``` -Here, `/path/to/script.js` is an absolute path to the script from the site root. One can also provide a relative path from the current page. For instance, `src="script.js"` would mean a file `"script.js"` in the current folder. +Here, `/path/to/script.js` is an absolute path to the script from the site root. One can also provide a relative path from the current page. For instance, `src="script.js"`, just like `src="./script.js"`, would mean a file `"script.js"` in the current folder. We can give a full URL as well. For instance: diff --git a/1-js/11-async/02-promise-basics/03-animate-circle-promise/solution.view/index.html b/1-js/11-async/02-promise-basics/03-animate-circle-promise/solution.view/index.html index 3229daf89..6052f009e 100644 --- a/1-js/11-async/02-promise-basics/03-animate-circle-promise/solution.view/index.html +++ b/1-js/11-async/02-promise-basics/03-animate-circle-promise/solution.view/index.html @@ -10,7 +10,7 @@ text-align: center; } .circle { - transition-property: width, height, margin-left, margin-top; + transition-property: width, height; transition-duration: 2s; position: fixed; transform: translateX(-50%) translateY(-50%); diff --git a/2-ui/2-events/01-introduction-browser-events/07-carousel/solution.view/index.html b/2-ui/2-events/01-introduction-browser-events/07-carousel/solution.view/index.html index 2c6073316..baf867664 100644 --- a/2-ui/2-events/01-introduction-browser-events/07-carousel/solution.view/index.html +++ b/2-ui/2-events/01-introduction-browser-events/07-carousel/solution.view/index.html @@ -10,7 +10,7 @@