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/05-types/article.md
+28Lines changed: 28 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -213,6 +213,7 @@ O tipo `symbol` é usado para criar identificadores únicos para objetos. Nós o
213
213
214
214
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.
215
215
216
+
<<<<<<< HEAD
216
217
Suporta duas formas de sintaxe:
217
218
218
219
1. Como operador: `typeof x`.
@@ -221,6 +222,9 @@ Suporta duas formas de sintaxe:
221
222
Em outras palavras, trabalha com parênteses ou sem eles. O resultado é o mesmo.
222
223
223
224
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:
As três últimas linhas podem precisar de explicações adicionais:
252
256
257
+
<<<<<<< HEAD
253
258
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.
254
259
2. O resultado de `typeofnull` é `"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.
255
260
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.
256
261
257
262
## 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 `typeofnull` 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
258
280
259
281
Existem 8 tipos básicos em JavaScript.
260
282
@@ -269,8 +291,14 @@ Existem 8 tipos básicos em JavaScript.
269
291
270
292
O operador `typeof` nos permite ver que tipo está armazenado em uma variável.
271
293
294
+
<<<<<<< HEAD
272
295
- Duas formas: `typeof x` ou `typeof(x)`.
273
296
- Retorna uma string com o nome do tipo, como `"string"`.
274
297
- 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
275
303
276
304
Nos próximos capítulos, nos vamos concentrar nos valores primitivos e, uma vez familiarizados com eles, passaremos para os objetos.
Copy file name to clipboardExpand all lines: 2-ui/3-event-details/6-pointer-events/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
@@ -271,7 +271,7 @@ Pointer events allow handling mouse, touch and pen events simultaneously, with a
271
271
272
272
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.
273
273
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.
0 commit comments