Skip to content

Commit 225a36f

Browse files
committed
Merge branch 'master' of github.com:javascript-tutorial/en.javascript.info
2 parents bcf2e48 + ee5853d commit 225a36f

File tree

5 files changed

+7
-22
lines changed

5 files changed

+7
-22
lines changed

1-js/02-first-steps/02-structure/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ alert(3 +
4646
+ 2);
4747
```
4848

49-
The code outputs `6` because JavaScript does not insert semicolons here. It is intuitively obvious that if the line ends with a plus `"+"`, then it is an "incomplete expression", so the semicolon is not required. And in this case that works as intended.
49+
The code outputs `6` because JavaScript does not insert semicolons here. It is intuitively obvious that if the line ends with a plus `"+"`, then it is an "incomplete expression", so a semicolon there would be incorrect. And in this case, that works as intended.
5050

5151
**But there are situations where JavaScript "fails" to assume a semicolon where it is really needed.**
5252

1-js/09-classes/04-private-protected-properties-methods/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ There's a finished JavaScript proposal, almost in the standard, that provides la
192192

193193
Privates should start with `#`. They are only accessible from inside the class.
194194

195-
For instance, here's a private `#waterLimit` property and the water-checking private method `#checkWater`:
195+
For instance, here's a private `#waterLimit` property and the water-checking private method `#fixWaterAmount`:
196196

197197
```js run
198198
class CoffeeMachine {

2-ui/5-loading/01-onload-ondomcontentloaded/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ For instance:
4545
<img id="img" src="https://en.js.cx/clipart/train.gif?speed=1&cache=0">
4646
```
4747

48-
In the example the `DOMContentLoaded` handler runs when the document is loaded, so it can see all the elements, including `<img>` below.
48+
In the example, the `DOMContentLoaded` handler runs when the document is loaded, so it can see all the elements, including `<img>` below.
4949

5050
But it doesn't wait for the image to load. So `alert` shows zero sizes.
5151

8-web-components/6-shadow-dom-style/article.md

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -111,22 +111,7 @@ customElements.define('custom-dialog', class extends HTMLElement {
111111

112112
Now the additional centering styles are only applied to the first dialog: `<custom-dialog centered>`.
113113

114-
## :host-context(selector)
115-
116-
Same as `:host`, but applied only if the shadow host or any of its ancestors in the outer document matches the `selector`.
117-
118-
E.g. `:host-context(.dark-theme)` matches only if there's `dark-theme` class on `<custom-dialog>` on anywhere above it:
119-
120-
```html
121-
<body class="dark-theme">
122-
<!--
123-
:host-context(.dark-theme) applies to custom-dialogs inside .dark-theme
124-
-->
125-
<custom-dialog>...</custom-dialog>
126-
</body>
127-
```
128-
129-
To summarize, we can use `:host`-family of selectors to style the main element of the component, depending on the context. These styles (unless `!important`) can be overridden by the document.
114+
To summarize, we can use `:host`-family of selectors to style the main element of the component. These styles (unless `!important`) can be overridden by the document.
130115

131116
## Styling slotted content
132117

@@ -317,7 +302,7 @@ Shadow DOM can include styles, such as `<style>` or `<link rel="stylesheet">`.
317302
318303
Local styles can affect:
319304
- shadow tree,
320-
- shadow host with `:host`-family pseudoclasses,
305+
- shadow host with `:host` and `:host()` pseudoclasses,
321306
- slotted elements (coming from light DOM), `::slotted(selector)` allows to select slotted elements themselves, but not their children.
322307
323308
Document styles can affect:

9-regular-expressions/17-regexp-methods/article.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ There are 3 differences from `match`:
6565
6666
1. It returns an iterable object with matches instead of an array. We can make a regular array from it using `Array.from`.
6767
2. Every match is returned as an array with capturing groups (the same format as `str.match` without flag `pattern:g`).
68-
3. If there are no results, it returns not `null`, but an empty iterable object.
68+
3. If there are no results, it returns an empty iterable object instead of `null`.
6969
7070
Usage example:
7171
@@ -247,7 +247,7 @@ alert('12-34-56'.replaceAll("-", ":")) // 12:34:56
247247

248248
## regexp.exec(str)
249249

250-
The method `regexp.exec(str)` method returns a match for `regexp` in the string `str`. Unlike previous methods, it's called on a regexp, not on a string.
250+
The `regexp.exec(str)` method returns a match for `regexp` in the string `str`. Unlike previous methods, it's called on a regexp, not on a string.
251251

252252
It behaves differently depending on whether the regexp has flag `pattern:g`.
253253

0 commit comments

Comments
 (0)