Fix typos

This commit is contained in:
Alexey Pyltsyn 2019-05-13 22:35:14 +03:00
parent 928f42d11f
commit 0490fa2549
3 changed files with 5 additions and 5 deletions

View file

@ -86,7 +86,7 @@ That's the correct variant:
[codetabs src="scopes-working" height="140" current="hello.js"]
In the browser, independant top-level scope also exists for each `<script type="module">`:
In the browser, independent top-level scope also exists for each `<script type="module">`:
```html run
<script type="module">
@ -263,7 +263,7 @@ When using modules, we should be aware that HTML-document can show up before the
### Async works on inline scripts
Async attribute `<script async type="module">` is allowed on both inline and external scripts. Async scripts run immediately when imported modules are processed, independantly of other scripts or the HTML document.
Async attribute `<script async type="module">` is allowed on both inline and external scripts. Async scripts run immediately when imported modules are processed, independently of other scripts or the HTML document.
For example, the script below has `async`, so it doesn't wait for anyone.

View file

@ -92,7 +92,7 @@ The `defer` attribute is ignored if the script has no `src`.
## async
The `async` attribute means that a script is completely independant:
The `async` attribute means that a script is completely independent:
- The page doesn't wait for async scripts, the contents is processed and displayed.
- `DOMContentLoaded` and async scripts don't wait each other:
@ -120,7 +120,7 @@ So, if we have several `async` scripts, they may execute in any order. Whatever
2. `DOMContentLoaded` may happen both before and after `async`, no guarantees here.
3. Async scripts don't wait for each other. A smaller script `small.js` goes second, but probably loads before `long.js`, so runs first. That's called a "load-first" order.
Async scripts are great when we integrate an independant third-party script into the page: counters, ads and so on.
Async scripts are great when we integrate an independent third-party script into the page: counters, ads and so on.
```html
<script async src="https://google-analytics.com/analytics.js"></script>

View file

@ -80,7 +80,7 @@ If we forget the `u` flag and occasionally use surrogate pairs, then we can get
Normally, regexps understand `[a-z]` as a "range of characters with codes between codes of `a` and `z`.
But without `u` flag, surrogate pairs are assumed to be a "pair of independant characters", so `[𝒳-𝒴]` is like `[<55349><56499>-<55349><56500>]` (replaced each surrogate pair with code points). Now we can clearly see that the range `56499-55349` is unacceptable, as the left range border must be less than the right one.
But without `u` flag, surrogate pairs are assumed to be a "pair of independent characters", so `[𝒳-𝒴]` is like `[<55349><56499>-<55349><56500>]` (replaced each surrogate pair with code points). Now we can clearly see that the range `56499-55349` is unacceptable, as the left range border must be less than the right one.
Using the `u` flag makes it work right: