Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 1dc6dfb

Browse files
authored
Merge pull request #2614 from jonathanlu31/patch-1
Fix grammar
2 parents 36788a5 + 727d314 commit 1dc6dfb

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

‎1-js/11-async/01-callbacks/article.md‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -196,9 +196,9 @@ So the single `callback` function is used both for reporting errors and passing
196196

197197
## Pyramid of Doom
198198

199-
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.
199+
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.
200200

201-
But for multiple asynchronous actions that follow one after another we'll have code like this:
201+
But for multiple asynchronous actions that follow one after another, we'll have code like this:
202202

203203
```js
204204
loadScript('1.js', function(error, script) {
@@ -229,8 +229,8 @@ loadScript('1.js', function(error, script) {
229229
```
230230

231231
In the code above:
232-
1. We load `1.js`, then if there's no error.
233-
2. We load `2.js`, then if there's no error.
232+
1. We load `1.js`, then if there's no error...
233+
2. We load `2.js`, then if there's no error...
234234
3. We load `3.js`, then if there's no error -- do something else `(*)`.
235235

236236
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) {
299299
}
300300
```
301301

302-
See? It does the same, and there's no deep nesting now because we made every action a separate top-level function.
302+
See? It does the same thing, and there's no deep nesting now because we made every action a separate top-level function.
303303

304304
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.
305305

‎2-ui/2-events/04-default-browser-action/article.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ There are two ways to tell the browser we don't want it to act:
1717
- The main way is to use the `event` object. There's a method `event.preventDefault()`.
1818
- If the handler is assigned using `on<event>` (not by `addEventListener`), then returning `false` also works the same.
1919

20-
In this HTML a click on a link doesn't lead to navigation, browser doesn't do anything:
20+
In this HTML, a click on a link doesn't lead to navigation; the browser doesn't do anything:
2121

2222
```html autorun height=60 no-beautify
2323
<a href="/" onclick="return false">Click here</a>
@@ -96,7 +96,7 @@ That's because the browser action is canceled on `mousedown`. The focusing is st
9696

9797
The optional `passive: true` option of `addEventListener` signals the browser that the handler is not going to call `preventDefault()`.
9898

99-
Why that may be needed?
99+
Why might that be needed?
100100

101101
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.
102102

‎2-ui/3-event-details/1-mouse-events-basics/article.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ In cases when a single action initiates multiple events, their order is fixed. T
3939
```online
4040
Click the button below and you'll see the events. Try double-click too.
4141
42-
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.
42+
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.
4343
44-
Also we can see the `button` property that allows to detect the mouse button, it's explained below.
44+
Also, we can see the `button` property that allows us to detect the mouse button; it's explained below.
4545
4646
<input onmousedown="return logMouse(event)" onmouseup="return logMouse(event)" onclick="return logMouse(event)" oncontextmenu="return logMouse(event)" ondblclick="return logMouse(event)" value="Click me with the right or the left mouse button" type="button"> <input onclick="logClear('test')" value="Clear" type="button"> <form id="testform" name="testform"> <textarea style="font-size:12px;height:150px;width:360px;"></textarea></form>
4747
```

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /