From ffcb5da587fc378f47ade5d5e3bc13d151133e5c Mon Sep 17 00:00:00 2001 From: jonathanlu31 <42872531+jonathanlu31@users.noreply.github.com> Date: Wed, 2 Jun 2021 11:11:48 -0700 Subject: [PATCH 1/4] Fix grammar --- 2-ui/2-events/04-default-browser-action/article.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/2-ui/2-events/04-default-browser-action/article.md b/2-ui/2-events/04-default-browser-action/article.md index ceac160c1f..cd815654fa 100644 --- a/2-ui/2-events/04-default-browser-action/article.md +++ b/2-ui/2-events/04-default-browser-action/article.md @@ -17,7 +17,7 @@ There are two ways to tell the browser we don't want it to act: - The main way is to use the `event` object. There's a method `event.preventDefault()`. - If the handler is assigned using `on` (not by `addEventListener`), then returning `false` also works the same. -In this HTML a click on a link doesn't lead to navigation, browser doesn't do anything: +In this HTML, a click on a link doesn't lead to navigation; the browser doesn't do anything: ```html autorun height=60 no-beautify Click here @@ -96,7 +96,7 @@ That's because the browser action is canceled on `mousedown`. The focusing is st The optional `passive: true` option of `addEventListener` signals the browser that the handler is not going to call `preventDefault()`. -Why that may be needed? +Why might that be needed? There are some events like `touchmove` on mobile devices (when the user moves their finger across the screen), that cause scrolling by default, but that scrolling can be prevented using `preventDefault()` in the handler. From 8f039d3806a30ee0691d2c14d43988551d72fe16 Mon Sep 17 00:00:00 2001 From: jonathanlu31 <42872531+jonathanlu31@users.noreply.github.com> Date: Wed, 2 Jun 2021 11:32:08 -0700 Subject: [PATCH 2/4] Fix grammar and typos in mouse events basics --- 2-ui/3-event-details/1-mouse-events-basics/article.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/2-ui/3-event-details/1-mouse-events-basics/article.md b/2-ui/3-event-details/1-mouse-events-basics/article.md index 4f3be1933c..ad12f25aa7 100644 --- a/2-ui/3-event-details/1-mouse-events-basics/article.md +++ b/2-ui/3-event-details/1-mouse-events-basics/article.md @@ -39,9 +39,9 @@ In cases when a single action initiates multiple events, their order is fixed. T ```online Click the button below and you'll see the events. Try double-click too. -On the teststand below all mouse events are logged, and if there is more than a 1 second delay between them they are separated by a horizontal ruler. +In the tests and below, all mouse events are logged, and if there is more than a 1 second delay between them, they are separated by a horizontal rule. -Also we can see the `button` property that allows to detect the mouse button, it's explained below. +Also, we can see the `button` property that allows us to detect the mouse button; it's explained below.
``` From 0786cfac090250a976da032b27e3bbea540b9552 Mon Sep 17 00:00:00 2001 From: jonathanlu31 <42872531+jonathanlu31@users.noreply.github.com> Date: Mon, 14 Jun 2021 13:27:08 -0700 Subject: [PATCH 3/4] Change back miscorrected typo --- 2-ui/3-event-details/1-mouse-events-basics/article.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/2-ui/3-event-details/1-mouse-events-basics/article.md b/2-ui/3-event-details/1-mouse-events-basics/article.md index ad12f25aa7..c322126e47 100644 --- a/2-ui/3-event-details/1-mouse-events-basics/article.md +++ b/2-ui/3-event-details/1-mouse-events-basics/article.md @@ -39,7 +39,7 @@ In cases when a single action initiates multiple events, their order is fixed. T ```online Click the button below and you'll see the events. Try double-click too. -In the tests and below, all mouse events are logged, and if there is more than a 1 second delay between them, they are separated by a horizontal rule. +On the teststand below, all mouse events are logged, and if there is more than a 1 second delay between them, they are separated by a horizontal rule. Also, we can see the `button` property that allows us to detect the mouse button; it's explained below. From 727d314238410b8bbcdb2626a1d6d9038690001f Mon Sep 17 00:00:00 2001 From: jonathanlu31 <42872531+jonathanlu31@users.noreply.github.com> Date: Mon, 14 Jun 2021 13:42:59 -0700 Subject: [PATCH 4/4] Minor changes in grammar and word choice --- 1-js/11-async/01-callbacks/article.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/1-js/11-async/01-callbacks/article.md b/1-js/11-async/01-callbacks/article.md index 344d92b742..a5d843b4ae 100644 --- a/1-js/11-async/01-callbacks/article.md +++ b/1-js/11-async/01-callbacks/article.md @@ -196,9 +196,9 @@ So the single `callback` function is used both for reporting errors and passing ## Pyramid of Doom -From the first look, it's a viable way of asynchronous coding. And indeed it is. For one or maybe two nested calls it looks fine. +At first glance, it looks like a viable approach to asynchronous coding. And indeed it is. For one or maybe two nested calls it looks fine. -But for multiple asynchronous actions that follow one after another we'll have code like this: +But for multiple asynchronous actions that follow one after another, we'll have code like this: ```js loadScript('1.js', function(error, script) { @@ -229,8 +229,8 @@ loadScript('1.js', function(error, script) { ``` In the code above: -1. We load `1.js`, then if there's no error. -2. We load `2.js`, then if there's no error. +1. We load `1.js`, then if there's no error... +2. We load `2.js`, then if there's no error... 3. We load `3.js`, then if there's no error -- do something else `(*)`. As calls become more nested, the code becomes deeper and increasingly more difficult to manage, especially if we have real code instead of `...` that may include more loops, conditional statements and so on. @@ -299,7 +299,7 @@ function step3(error, script) { } ``` -See? It does the same, and there's no deep nesting now because we made every action a separate top-level function. +See? It does the same thing, and there's no deep nesting now because we made every action a separate top-level function. It works, but the code looks like a torn apart spreadsheet. It's difficult to read, and you probably noticed that one needs to eye-jump between pieces while reading it. That's inconvenient, especially if the reader is not familiar with the code and doesn't know where to eye-jump.