You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 1-js/02-first-steps/06-type-conversions/article.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Conversione di tipi
2
2
3
-
Nella maggior parte dei casi, operatori e funzioni convertono automaticamente il valore nel tipo corretto. Questo viene detto "conversione di tipi".
3
+
Nella maggior parte dei casi, operatori e funzioni convertono automaticamente il valore nel tipo corretto.
4
4
5
5
Ad esempio, `alert` converte automaticamente un valore qualsiasi in una stringa, per poterla mostrare. Le operazioni matematica convertono i valori in numeri.
Copy file name to clipboardExpand all lines: 1-js/02-first-steps/14-function-basics/article.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -380,7 +380,7 @@ Questi esempi assumono i significati comuni dei prefissi. Il loro significato di
380
380
```smart header="Nomi di funzioni ultra-corti"
381
381
Funzioni che vengono utilizzate *molto spesso* potrebbero avere nomi molto corti.
382
382
383
-
Ad esempio il framework [jQuery](http://jquery.com) definisce una funzione con `$`. La libreria [LoDash](http://lodash.com/) ha nel core una funzione denominata `_`.
383
+
Ad esempio il framework [jQuery](http://jquery.com) definisce una funzione con `$`. La libreria [Lodash](http://lodash.com/) ha nel core una funzione denominata `_`.
384
384
385
385
Queste sono eccezioni. Generalmente i nomi delle funzioni sono precisi e descrittivi.
Copy file name to clipboardExpand all lines: 1-js/08-prototypes/02-function-prototype/article.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -43,7 +43,7 @@ On the picture, `"prototype"` is a horizontal arrow, meaning a regular property,
43
43
```smart header="`F.prototype` only used at `new F` time"
44
44
`F.prototype` property is only used when `new F` is called, it assigns `[[Prototype]]` of the new object. After that, there's no connection between `F.prototype` and the new object. Think of it as a "one-time gift".
45
45
46
-
If, after the creation, `F.prototype` property changes (`F.property = <another object>`), then new objects created by `new F` will have another object as `[[Prototype]]`, but already existing objects keep the old one.
46
+
If, after the creation, `F.prototype` property changes (`F.prototype = <another object>`), then new objects created by `new F` will have another object as `[[Prototype]]`, but already existing objects keep the old one.
Copy file name to clipboardExpand all lines: 1-js/09-classes/01-class/article.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -86,7 +86,7 @@ alert(typeof User); // function
86
86
87
87
What `class User {...}` construct really does is:
88
88
1. Creates a function named `User`, that becomes the result of the class declaration.
89
-
- The function code is taken from the `constructor` method (assumed empty is we don't write such method).
89
+
- The function code is taken from the `constructor` method (assumed empty if we don't write such method).
90
90
3. Stores all methods, such as `sayHi`, in `User.prototype`.
91
91
92
92
Afterwards, for new objects, when we call a method, it's taken from the prototype, just as described in the chapter <info:function-prototype>. So `new User` object has access to class methods.
Copy file name to clipboardExpand all lines: 1-js/13-modules/02-import-export/article.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -377,7 +377,7 @@ export {default as Github} from './providers/github.js';
377
377
````warn header="Re-exporting default is tricky"
378
378
Please note: `exportUserfrom'./user.js'` won't work. It's actually a syntax error. To re-export the default export, we must mention it explicitly `{defaultas ...}`, like in the example above.
379
379
380
-
Also, there's another oddity: `export*from'./user.js'` re-exports only named exports, exluding the default one. Once again, we need to mention it explicitly.
380
+
Also, there's another oddity: `export*from'./user.js'` re-exports only named exports, excluding the default one. Once again, we need to mention it explicitly.
381
381
382
382
For instance, to re-export everything, two statements will be necessary:
Copy file name to clipboardExpand all lines: 8-web-components/1-webcomponents-intro/article.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -56,7 +56,8 @@ Components may have subcomponents, e.g. messages may be parts of a higher-level
56
56
57
57
How do we decide, what is a component? That comes from intuition, experience and common sense. Usually it's a separate visual entity that we can describe in terms of what it does and how it interacts with the page. In the case above, the page has blocks, each of them plays its own role, it's logical to make these components.
58
58
59
-
- A component has its own JavaScript class.
59
+
A component has:
60
+
- its own JavaScript class.
60
61
- DOM structure, managed solely by its class, outside code doesn't access it ("encapsulation" principle).
61
62
- CSS styles, applied to the component.
62
63
- API: events, class methods etc, to interact with other components.
Copy file name to clipboardExpand all lines: 9-regular-expressions/02-regexp-methods/article.md
+10-10Lines changed: 10 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,7 +10,9 @@ There are two sets of methods to deal with regular expressions.
10
10
11
11
Which method to use depends on what we'd like to do.
12
12
13
-
Methods become much easier to understand if we separate them by their use in real-life tasks:
13
+
Methods become much easier to understand if we separate them by their use in real-life tasks.
14
+
15
+
So, here are general recipes, the details to follow:
14
16
15
17
**To search for all matches:**
16
18
@@ -30,9 +32,7 @@ Use regexp `g` flag and:
30
32
**To split the string by a separator:**
31
33
-`str.split(str|reg)`
32
34
33
-
Now you get the details about every method in this chapter... But if you're reading for the first time, and want to know more about regexps - go ahead!
34
-
35
-
You may want to skip methods for now, move on to the next chapter, and then return here if something about a method is unclear.
35
+
Now you can continue reading this chapter to get the details about every method... But if you're reading for the first time, then you probably want to know more about regexps. So you can move to the next chapter, and then return here if something about a method is unclear.
36
36
37
37
## str.search(reg)
38
38
@@ -41,12 +41,12 @@ We've seen this method already. It returns the position of the first match or `-
41
41
```js run
42
42
let str ="A drop of ink may make a million think";
43
43
44
-
alert( str.search( *!*/a/i*/!* ) ); //0 (the first position)
44
+
alert( str.search( *!*/a/i*/!* ) ); //0 (first match at zero position)
45
45
```
46
46
47
47
**The important limitation: `search` only finds the first match.**
48
48
49
-
We can't find next positions using `search`, there's just no syntax for that. But there are other methods that can.
49
+
We can't find next matches using `search`, there's just no syntax for that. But there are other methods that can.
````warn header="Same global regexp tested repeatedly may fail to match"
436
-
If we apply the same global regexp to different inputs, it may lead to wrong result, because `regexp.test` call advances `regexp.lastIndex` property, so next matches start from non-zero position.
436
+
If we apply the same global regexp to different inputs, it may lead to wrong result, because `regexp.test` call advances `regexp.lastIndex` property, so the search in another string may start from non-zero position.
437
437
438
438
For instance, here we call `regexp.test` twice on the same text, and the second time fails:
0 commit comments