Skip to content

Commit 6bc49fb

Browse files
authored
Merge pull request #189 from javascript-tutorial/sync-97ef8624
Sync with upstream @ 97ef862
2 parents 6247879 + 366b5f4 commit 6bc49fb

File tree

8 files changed

+9
-12
lines changed

8 files changed

+9
-12
lines changed

1-js/02-first-steps/14-switch/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ switch (a) {
4747
break;
4848
*/!*
4949
case 5:
50-
alert( 'Too large' );
50+
alert( 'Too big' );
5151
break;
5252
default:
5353
alert( "I don't know such values" );
Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
function topSalary(salaries) {
22

3-
let max = 0;
3+
let maxSalary = 0;
44
let maxName = null;
55

66
for(const [name, salary] of Object.entries(salaries)) {
77
if (max < salary) {
8-
max = salary;
8+
maxSalary = salary;
99
maxName = name;
1010
}
1111
}
1212

1313
return maxName;
14-
}
15-
16-
14+
}

1-js/09-classes/01-class/article.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ user.sayHi();
5151
```
5252

5353
Quando viene chiamato `new User("John")`:
54-
5554
1. Viene creato un nuovo oggetto;
5655
2. Il metodo `constructor()` viene richiamato e assegna a `this.name` l'argomento dato.
5756

1-js/09-classes/02-class-inheritance/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ rabbit.run(5); // White Rabbit runs with speed 5.
5353
rabbit.hide(); // White Rabbit hides!
5454
```
5555

56-
Ora il codice di `Rabbit` è diventato un po' più corto, dato che utilizza il costruttore di `Animal`, e può anche correre (usare il metodo `run`) come gli animali (animals).
56+
L'oggetto della classe `Rabbit` ha accesso sia ai metodi di `Rabbit` (ad esempio `rabbit.hide()`) che a quelli di `Animal` (`rabbit.run()`).
5757

5858
Internamente, `extends` aggiunge da `Rabbit.prototype` un riferimento `[[Prototype]]` a `Animal.prototype`:
5959

1-js/09-classes/07-mixins/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ let sayMixin = {
6969
};
7070

7171
let sayHiMixin = {
72-
__proto__: sayMixin, // (or we could use Object.create to set the prototype here)
72+
__proto__: sayMixin, // (or we could use Object.setPrototypeOf to set the prototype here)
7373

7474
sayHi() {
7575
*!*

9-regular-expressions/13-regexp-alternation/03-match-quoted-string/solution.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ The solution: `pattern:/"(\\.|[^"\\])*"/g`.
33
Step by step:
44

55
- First we look for an opening quote `pattern:"`
6-
- Then if we have a backslash `pattern:\\` (we technically have to double it in the pattern, because it is a special character, so that's a single backslash in fact), then any character is fine after it (a dot).
6+
- Then if we have a backslash `pattern:\\` (we have to double it in the pattern because it is a special character), then any character is fine after it (a dot).
77
- Otherwise we take any character except a quote (that would mean the end of the string) and a backslash (to prevent lonely backslashes, the backslash is only used with some other symbol after it): `pattern:[^"\\]`
88
- ...And so on till the closing quote.
99

9-regular-expressions/14-regexp-lookahead-lookbehind/1-find-non-negative-integers/solution.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
The regexp for an integer number is `pattern:\d+`.
33

4-
We can exclude negatives by prepending it with the negative lookahead: `pattern:(?<!-)\d+`.
4+
We can exclude negatives by prepending it with the negative lookbehind: `pattern:(?<!-)\d+`.
55

66
Although, if we try it now, we may notice one more "extra" result:
77

9-regular-expressions/14-regexp-lookahead-lookbehind/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Lookahead and lookbehind
22

3-
Sometimes we need to find only those matches for a pattern that are followed or preceeded by another pattern.
3+
Sometimes we need to find only those matches for a pattern that are followed or preceded by another pattern.
44

55
There's a special syntax for that, called "lookahead" and "lookbehind", together referred to as "lookaround".
66

0 commit comments

Comments
 (0)