Skip to content

Commit 727d314

Browse files
authored
Minor changes in grammar and word choice
1 parent 0786cfa commit 727d314

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

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

+5-5
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

0 commit comments

Comments
 (0)