Skip to content

Commit 5e66b62

Browse files
committed
merging all conflicts
2 parents b9d6e76 + 8d04d0d commit 5e66b62

File tree

4 files changed

+35
-5
lines changed

4 files changed

+35
-5
lines changed

1-js/02-first-steps/05-types/article.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ O tipo `symbol` é usado para criar identificadores únicos para objetos. Nós o
213213
214214
O operador `typeof` retorna o tipo do argumento. É útil quando queremos processar valores de diferentes tipos de forma diferente ou apenas queremos fazer uma verificação rápida.
215215
216+
<<<<<<< HEAD
216217
Suporta duas formas de sintaxe:
217218
218219
1. Como operador: `typeof x`.
@@ -221,6 +222,9 @@ Suporta duas formas de sintaxe:
221222
Em outras palavras, trabalha com parênteses ou sem eles. O resultado é o mesmo.
222223
223224
A chamada para `typeof x` retorna uma string com o nome do tipo:
225+
=======
226+
A call to `typeof x` returns a string with the type name:
227+
>>>>>>> 8d04d0d2db97276dbb2b451c30a7bd3e05d65831
224228
225229
```js
226230
typeof undefined // "undefined"
@@ -250,11 +254,29 @@ typeof alert // "function" (3)
250254
251255
As três últimas linhas podem precisar de explicações adicionais:
252256
257+
<<<<<<< HEAD
253258
1. `Math` é um objeto embutido que fornece operações matemáticas. Nós o vamos aprender no capítulo <info:number>. Aqui, ele serve apenas como um exemplo de um objeto.
254259
2. O resultado de `typeof null` é `"object"`. É um erro oficialmente reconhecido no comportamento de `typeof` e mantido para compatibilidade. Naturalmente, `null` não é um objeto. É um valor especial com um tipo separado próprio.
255260
3. O resultado de `typeof alert` é `"function"`, porque `alert` é uma função. Vamos estudar as funções nos próximos capítulos onde veremos também que não há nenhum tipo especial "função" em JavaScript. As funções pertencem ao tipo objecto. Mas o `typeof` as trata de forma diferente, retornando `"function"`. Isto, também vem dos primeiros dias do JavaScript. Tecnicamente, é incorreto, mas muito conveniente na prática.
256261
257262
## Resumo
263+
=======
264+
1. `Math` is a built-in object that provides mathematical operations. We will learn it in the chapter <info:number>. Here, it serves just as an example of an object.
265+
2. The result of `typeof null` is `"object"`. That's an officially recognized error in `typeof`, coming from very early days of JavaScript and kept for compatibility. Definitely, `null` is not an object. It is a special value with a separate type of its own. The behavior of `typeof` is wrong here.
266+
3. The result of `typeof alert` is `"function"`, because `alert` is a function. We'll study functions in the next chapters where we'll also see that there's no special "function" type in JavaScript. Functions belong to the object type. But `typeof` treats them differently, returning `"function"`. That also comes from the early days of JavaScript. Technically, such behavior isn't correct, but can be convenient in practice.
267+
268+
```smart header="The `typeof(x)` syntax"
269+
You may also come across another syntax: `typeof(x)`. It's the same as `typeof x`.
270+
271+
To put it clear: `typeof` is an operator, not a function. The parentheses here aren't a part of `typeof`. It's the kind of parentheses used for mathematical grouping.
272+
273+
Usually, such parentheses contain a mathematical expression, such as `(2 + 2)`, but here they contain only one argument `(x)`. Syntactically, they allow to avoid a space between the `typeof` operator and its argument, and some people like it.
274+
275+
Some people prefer `typeof(x)`, although the `typeof x` syntax is much more common.
276+
```
277+
278+
## Summary
279+
>>>>>>> 8d04d0d2db97276dbb2b451c30a7bd3e05d65831
258280
259281
Existem 8 tipos básicos em JavaScript.
260282
@@ -269,8 +291,14 @@ Existem 8 tipos básicos em JavaScript.
269291
270292
O operador `typeof` nos permite ver que tipo está armazenado em uma variável.
271293
294+
<<<<<<< HEAD
272295
- Duas formas: `typeof x` ou `typeof(x)`.
273296
- Retorna uma string com o nome do tipo, como `"string"`.
274297
- Para `null` retorna `"object"` -- isso é um erro na linguagem, não é realmente um objeto.
298+
=======
299+
- Usually used as `typeof x`, but `typeof(x)` is also possible.
300+
- Returns a string with the name of the type, like `"string"`.
301+
- For `null` returns `"object"` -- this is an error in the language, it's not actually an object.
302+
>>>>>>> 8d04d0d2db97276dbb2b451c30a7bd3e05d65831
275303

276304
Nos próximos capítulos, nos vamos concentrar nos valores primitivos e, uma vez familiarizados com eles, passaremos para os objetos.

1-js/04-object-basics/04-object-methods/8-chain-calls/solution.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ let ladder = {
2323
}
2424
};
2525

26-
ladder.up().up().down().up().down().showStep(); // 1
26+
ladder.up().up().down().showStep().down().showStep(); // shows 1 then 0
2727
```
2828

2929
We also can write a single call per line. For long chains it's more readable:
@@ -33,7 +33,7 @@ ladder
3333
.up()
3434
.up()
3535
.down()
36-
.up()
36+
.showStep() // 1
3737
.down()
38-
.showStep(); // 1
38+
.showStep(); // 0
3939
```

1-js/04-object-basics/04-object-methods/8-chain-calls/task.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,14 @@ ladder.up();
2828
ladder.up();
2929
ladder.down();
3030
ladder.showStep(); // 1
31+
ladder.down();
32+
ladder.showStep(); // 0
3133
```
3234

3335
Modify the code of `up`, `down` and `showStep` to make the calls chainable, like this:
3436

3537
```js
36-
ladder.up().up().down().showStep(); // 1
38+
ladder.up().up().down().showStep().down().showStep(); // shows 1 then 0
3739
```
3840

3941
Such approach is widely used across JavaScript libraries.

2-ui/3-event-details/6-pointer-events/article.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ Pointer events allow handling mouse, touch and pen events simultaneously, with a
271271

272272
Pointer events extend mouse events. We can replace `mouse` with `pointer` in event names and expect our code to continue working for mouse, with better support for other device types.
273273

274-
For drag'n'drops and complex touch interactions that the browser may decide to hijack and handle on its own - remember to cancel the default action on events and set `touch-events: none` in CSS for elements that we engage.
274+
For drag'n'drops and complex touch interactions that the browser may decide to hijack and handle on its own - remember to cancel the default action on events and set `touch-action: none` in CSS for elements that we engage.
275275

276276
Additional abilities of pointer events are:
277277

0 commit comments

Comments
 (0)