Skip to content

Commit 4153ced

Browse files
authored
Merge branch 'master' into master
2 parents 7e89947 + 59a4159 commit 4153ced

File tree

9 files changed

+21
-21
lines changed

9 files changed

+21
-21
lines changed

1-js/02-first-steps/13-while-for/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ Let's examine the `for` statement part-by-part:
106106

107107
| part | | |
108108
|-------|----------|----------------------------------------------------------------------------|
109-
| begin | `i = 0` | Executes once upon entering the loop. |
109+
| begin | `let i = 0` | Executes once upon entering the loop. |
110110
| condition | `i < 3`| Checked before every loop iteration. If false, the loop stops. |
111111
| body | `alert(i)`| Runs again and again while the condition is truthy. |
112112
| step| `i++` | Executes after the body on each iteration. |

1-js/05-data-types/02-number/article.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ In modern JavaScript, there are two types of numbers:
44

55
1. Regular numbers in JavaScript are stored in 64-bit format [IEEE-754](https://en.wikipedia.org/wiki/IEEE_754-2008_revision), also known as "double precision floating point numbers". These are numbers that we're using most of the time, and we'll talk about them in this chapter.
66

7-
2. BigInt numbers, to represent integers of arbitrary length. They are sometimes needed, because a regular number can't exceed <code>2<sup>53</sup></code> or be less than <code>-2<sup>53</sup></code>. As bigints are used in few special areas, we devote them a special chapter <info:bigint>.
7+
2. BigInt numbers, to represent integers of arbitrary length. They are sometimes needed, because a regular number can't safely exceed <code>2<sup>53</sup></code> or be less than <code>-2<sup>53</sup></code>. As bigints are used in few special areas, we devote them a special chapter <info:bigint>.
88

99
So here we'll talk about regular numbers. Let's expand our knowledge of them.
1010

@@ -53,7 +53,7 @@ Just like before, using `"e"` can help. If we'd like to avoid writing the zeroes
5353
let ms = 1e-6; // six zeroes to the left from 1
5454
```
5555

56-
If we count the zeroes in `0.000001`, there are 6 of them. So naturally it's `1e-6`.
56+
If we count the zeroes in `0.000001`, there are 6 of them. So naturally it's `1e-6`.
5757

5858
In other words, a negative number after `"e"` means a division by 1 with the given number of zeroes:
5959

@@ -329,7 +329,7 @@ let num = +prompt("Enter a number", '');
329329
alert( isFinite(num) );
330330
```
331331

332-
Please note that an empty or a space-only string is treated as `0` in all numeric functions including `isFinite`.
332+
Please note that an empty or a space-only string is treated as `0` in all numeric functions including `isFinite`.
333333

334334
```smart header="Compare with `Object.is`"
335335

1-js/06-advanced-functions/04-var/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
```smart header="This article is for understanding old scripts"
55
The information in this article is useful for understanding old scripts.
66
7-
That's not how we write a new code.
7+
That's not how we write new code.
88
```
99

1010
In the very first chapter about [variables](info:variables), we mentioned three ways of variable declaration:

1-js/07-object-properties/01-property-descriptors/article.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Nós não vimos eles ainda, porque geralmente eles não aparecem. Quando criamos
1919

2020
Primeiro, vamos ver como obter esses sinalizadores.
2121

22-
O método [Object.getOwnPropertyDescriptor](mdn:js/Object/getOwnPropertyDescriptor) nos permite consultar a informação *completa* sobre a propriedade.
22+
O método [Object.getOwnPropertyDescriptor](https://developer.mozilla.org/pt-BR/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyDescriptor) nos permite consultar a informação *completa* sobre a propriedade.
2323

2424
A sintaxe é:
2525
```js
@@ -54,7 +54,7 @@ alert( JSON.stringify(descriptor, null, 2 ) );
5454
*/
5555
```
5656

57-
Para mudar os sinalizadores, nós podemos usar o [Object.defineProperty](mdn:js/Object/defineProperty).
57+
Para mudar os sinalizadores, nós podemos usar o [Object.defineProperty](https://developer.mozilla.org/pt-BR/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty).
5858

5959
A sintaxe é:
6060

@@ -144,6 +144,7 @@ alert(user.name); // John
144144
user.name = "Alice"; // Erro
145145
```
146146

147+
147148
## Não-enumerável
148149

149150
Agora, vamos adicionar um `toString` customizado ao `user`.
@@ -274,7 +275,7 @@ We can change `writable: true` to `false` for a non-configurable property, thus
274275

275276
## Object.defineProperties
276277

277-
Existe um método [Object.defineProperties(obj, descriptors)](mdn:js/Object/defineProperties) que permite definir várias propriedades de uma vez.
278+
Existe um método [Object.defineProperties(obj, descriptors)](https://developer.mozilla.org/pt-BR/docs/Web/JavaScript/Reference/Global_Objects/Object/defineProperty) que permite definir várias propriedades de uma vez.
278279

279280
A sintaxe é:
280281

@@ -300,7 +301,7 @@ Então, nós podemos configurar várias propriedades de uma vez.
300301

301302
## Object.getOwnPropertyDescriptors
302303

303-
Para obter todos os sinalizadores de propriedade de uma vez, nós podemos usar o método [Object.getOwnPropertyDescriptors(obj)](mdn:js/Object/getOwnPropertyDescriptors).
304+
Para obter todos os sinalizadores de propriedade de uma vez, nós podemos usar o método [Object.getOwnPropertyDescriptors(obj)](https://developer.mozilla.org/pt-BR/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyDescriptors).
304305

305306
Juntamente com `Object.defineProperties` isso pode ser usado como um jeito "incluindo-sinalizadores" de clonar objetos:
306307

@@ -326,24 +327,24 @@ Descritores de propriedade atuam no mesmo nível de propriedades individuais.
326327

327328
Também existem métodos que limitam o acesso ao objeto *inteiro*:
328329

329-
[Object.preventExtensions(obj)](mdn:js/Object/preventExtensions)
330+
[Object.preventExtensions(obj)](https://developer.mozilla.org/pt-BR/docs/Web/JavaScript/Reference/Global_Objects/Object/preventExtensions)
330331
: Proíbe a adição de novas propriedades ao objeto.
331332

332-
[Object.seal(obj)](mdn:js/Object/seal)
333+
[Object.seal(obj)](https://developer.mozilla.org/pt-BR/docs/Web/JavaScript/Reference/Global_Objects/Object/seal)
333334
: Proíbe a adição/remoção de propriedades. Coloca `configurable: false` para todas as propriedades existentes.
334335

335-
[Object.freeze(obj)](mdn:js/Object/freeze)
336+
[Object.freeze(obj)](https://developer.mozilla.org/pt-BR/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze)
336337
: Proíbe adicionar/remover/alterar propriedades. Coloca `configurable: false, writable: false` para todas as propriedades existentes.
337338

338339
E também existem testes para eles:
339340

340-
[Object.isExtensible(obj)](mdn:js/Object/isExtensible)
341+
[Object.isExtensible(obj)](https://developer.mozilla.org/pt-BR/docs/Web/JavaScript/Reference/Global_Objects/Object/isExtensible)
341342
: Retorna `false` se a adição de propriedades é proibida, caso contrátio `true`.
342343

343-
[Object.isSealed(obj)](mdn:js/Object/isSealed)
344+
[Object.isSealed(obj)](https://developer.mozilla.org/pt-BR/docs/Web/JavaScript/Reference/Global_Objects/Object/isSealed)
344345
: Retorna `true` se adição/remoção de propriedades são proibidas, e todas as propriedades existentes são `configurable: false`.
345346

346-
[Object.isFrozen(obj)](mdn:js/Object/isFrozen)
347+
[Object.isFrozen(obj)](https://developer.mozilla.org/pt-BR/docs/Web/JavaScript/Reference/Global_Objects/Object/isFrozen)
347348
: Retorna `true` se adição/remoção/alteração de propriedades são proibidas, e todas as propriedades atuais são `configurable: false, writable: false`.
348349

349350
Estes métodos são raramentes usados na prática.

1-js/11-async/03-promise-chaining/article.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -332,8 +332,7 @@ function loadJson(url) {
332332
}
333333

334334
function loadGithubUser(name) {
335-
return fetch(`https://api.github.com/users/${name}`)
336-
.then(response => response.json());
335+
return loadJson(`https://api.github.com/users/${name}`);
337336
}
338337

339338
function showAvatar(githubUser) {

2-ui/4-forms-controls/3-events-change-input/1-deposit-calculator/solution.view/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@
9696
let years = form.months.value / 12;
9797
if (!years) return;
9898

99-
let result = Math.round(initial * (1 + interest * years));
99+
let result = Math.round(initial * (1 + interest) ** years);
100100

101101
let height = result / form.money.value * 100 + 'px';
102102
document.getElementById('height-after').style.height = height;

2-ui/4-forms-controls/3-events-change-input/1-deposit-calculator/task.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ The formula is:
1717
// initial: the initial money sum
1818
// interest: e.g. 0.05 means 5% per year
1919
// years: how many years to wait
20-
let result = Math.round(initial * (1 + interest * years));
20+
let result = Math.round(initial * (1 + interest) ** years);
2121
```

2-ui/4-forms-controls/3-events-change-input/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ For instance, the code below prevents all such events and shows what we are tryi
6464

6565
Please note, that it's possible to copy/paste not just text, but everything. For instance, we can copy a file in the OS file manager, and paste it.
6666

67-
That's because `clipboardData` implements `DataTransfer` interface, commonly used for drag'n'drop and copy/pasting. It's bit beyound our scope now, but you can find its methods [in the specification](https://html.spec.whatwg.org/multipage/dnd.html#the-datatransfer-interface).
67+
That's because `clipboardData` implements `DataTransfer` interface, commonly used for drag'n'drop and copy/pasting. It's bit beyond our scope now, but you can find its methods [in the specification](https://html.spec.whatwg.org/multipage/dnd.html#the-datatransfer-interface).
6868

6969
```warn header="ClipboardAPI: user safety restrictions"
7070
The clipboard is a "global" OS-level thing. So most browsers allow read/write access to the clipboard only in the scope of certain user actions for the safety, e.g. in `onclick` event handlers.

7-animation/2-css-animations/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ A propriedade `transform` é uma grande escolha, porque:
433433

434434
Por outras palavras, o navegador calcula a Layout (tamanhos, posições), pinta-a com cores, fundo, etc no estágio Paint, e depois aplica `transform` a caixas de elementos que precisarem.
435435

436-
Mudanças (animações) da propriedade `transform` nunca desencadeiam os passos Layout e Paint. E ainda mais, o navegador explora o acelerador de gráficos (um *chip* especial na *CPU* ou placa gráfica) para transformações CSS, tornando-as muito eficientes.
436+
Mudanças (animações) da propriedade `transform` nunca desencadeiam os passos Layout e Paint. E ainda mais, o navegador explora o acelerador de gráficos (um *chip* especial na *CPU* ou placa gráfica) para transformações CSS, tornando-as assim muito eficientes.
437437

438438
Felizmente, a propriedade `transform` é muito poderosa. Ao usar `transform` em um elemento, você pode rodá-lo e virá-lo, esticá-lo e encolhê-lo, deslocá-lo, e [muito mais](https://developer.mozilla.org/pt-BR/docs/Web/CSS/transform), Assim, em vez das propriedades `left/margin-left` nós podemos usar `transform: translateX(…)`, usar `transform: scale` para aumentar o tamanho de um elemento, etc.
439439

0 commit comments

Comments
 (0)