Skip to content

Commit 7fd3eb1

Browse files
committed
minor
1 parent 99cbc65 commit 7fd3eb1

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

5-network/01-fetch/article.md

+5-3
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ For example, we can use a network request to:
1212

1313
...And all of that without reloading the page!
1414

15-
There's an umbrella term "AJAX" (abbreviated <b>A</b>synchronous <b>J</b>avaScript <b>A</b>nd <b>X</b>ML) for network requests from JavaScript. We don't have to use XML though: the term comes from old times, that's that word is there. You may have heard that term already.
15+
There's an umbrella term "AJAX" (abbreviated <b>A</b>synchronous <b>J</b>avaScript <b>A</b>nd <b>X</b>ML) for network requests from JavaScript. We don't have to use XML though: the term comes from old times, that's why that word is there. You may have heard that term already.
1616

1717
There are multiple ways to send a network request and get information from the server.
1818

19-
The `fetch()` method is modern and versatile, so we'll start with it. It's not supported by old browsers (can be polyfilled), but very well supported among the new ones.
19+
The `fetch()` method is modern and versatile, so we'll start with it. It's not supported by old browsers (can be polyfilled), but very well supported among the modern ones.
2020

2121
The basic syntax is:
2222

@@ -27,11 +27,13 @@ let promise = fetch(url, [options])
2727
- **`url`** -- the URL to access.
2828
- **`options`** -- optional parameters: method, headers etc.
2929

30+
Without `options`, that is a simple GET request, downloading the contents of the `url`.
31+
3032
The browser starts the request right away and returns a promise that the calling code should use to get the result.
3133

3234
Getting a response is usually a two-stage process.
3335

34-
**First, the `promise` resolves with an object of the built-in [Response](https://fetch.spec.whatwg.org/#response-class) class as soon as the server responds with headers.**
36+
**First, the `promise`, returned by `fetch`, resolves with an object of the built-in [Response](https://fetch.spec.whatwg.org/#response-class) class as soon as the server responds with headers.**
3537

3638
At this stage we can check HTTP status, to see whether it is successful or not, check headers, but don't have the body yet.
3739

9-regular-expressions/09-regexp-groups/article.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@ The pattern: `pattern:[-.\w]+@([\w-]+\.)+[\w-]{2,20}`.
3535

3636
That regexp is not perfect, but good enough to fix errors or occasional mistypes.
3737

38-
For instance, we can find all emails in the string:
38+
For instance, we can find all emails in the string:
3939

4040
```js run
4141
let reg = /[-.\w]+@([\w-]+\.)+[\w-]{2,20}/g;
4242

4343
alert("my@mail.com @ his@site.com.uk".match(reg)); // my@mail.com, his@site.com.uk
4444
```
4545

46-
In this example parentheses were used to make a group for repeating `pattern:(...)+`. But there are other uses too, let's see them.
46+
In this example parentheses were used to make a group for repetitions `pattern:([\w-]+\.)+`. But there are other uses too, let's see them.
4747

4848
## Contents of parentheses
4949

@@ -53,7 +53,7 @@ For instance, we'd like to find HTML tags `pattern:<.*?>`, and process them.
5353

5454
Let's wrap the inner content into parentheses, like this: `pattern:<(.*?)>`.
5555

56-
We'll get both the tag as a whole and its content as an array:
56+
Then we'll get both the tag as a whole and its content:
5757

5858
```js run
5959
let str = '<h1>Hello, world!</h1>';
@@ -111,7 +111,7 @@ Then groups, numbered from left to right. Whichever opens first gives the first
111111

112112
Then in `result[2]` goes the group from the second opening `pattern:(` till the corresponding `pattern:)` -- tag name, then we don't group spaces, but group attributes for `result[3]`.
113113

114-
**If a group is optional and doesn't exist in the match, the corresponding `result` index is present (and equals `undefined`).**
114+
**Even if a group is optional and doesn't exist in the match, the corresponding `result` array item is present (and equals `undefined`).**
115115

116116
For instance, let's consider the regexp `pattern:a(z)?(c)?`. It looks for `"a"` optionally followed by `"z"` optionally followed by `"c"`.
117117

@@ -208,7 +208,7 @@ let rearranged = str.replace(dateRegexp, (str, ...args) => {
208208

209209
## Non-capturing groups with ?:
210210

211-
Sometimes we need parentheses to correctly apply a quantifier, but we don't want the contents in results.
211+
Sometimes we need parentheses to correctly apply a quantifier, but we don't want their contents in results.
212212

213213
A group may be excluded by adding `pattern:?:` in the beginning.
214214

0 commit comments

Comments
 (0)