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: problems/object-keys/problem_pt-br.md
+9-10Lines changed: 9 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,6 @@
1
-
JavaScript provides a native way of listing all the available keys of an object. This can be helpful for looping through all the properties of an object and manipulating their values accordingly.
1
+
JavaScript nos fornece uma maneira nativa de listar todas as _chaves_ (_keys_) disponiveis de um objeto. Isso pode ser util para iterar em todas as propriedades de um objeto e manipular seus valores.
2
2
3
-
Here's an example of listing all object keys using the **Object.keys()**
4
-
prototype method.
3
+
Vejamos um exemplo de como podemos listar todas as chaves de um objeto utilizando o método Object.keys():
5
4
6
5
```js
7
6
constcar= {
@@ -14,13 +13,13 @@ const keys = Object.keys(car)
14
13
console.log(keys)
15
14
```
16
15
17
-
The above code will print an array of strings, where each string is a key in the car object.`['make', 'model', 'year']`
16
+
O código acima imprime um array de _strings_, onde cada _string_ é uma _chave_ (_key_) do objeto `car`. `['make', 'model', 'year']`
18
17
19
-
## The challenge:
18
+
## Desafio:
20
19
21
-
Create a file named`object-keys.js`.
20
+
Crie um arquivo chamado`object-keys.js`.
22
21
23
-
In that file, define a variable named`car` like this:
22
+
Dentro desse arquivo, defina uma variavel chamada`car`:
24
23
25
24
```js
26
25
constcar= {
@@ -30,14 +29,14 @@ const car = {
30
29
}
31
30
```
32
31
33
-
Then define another variable named`keys` like this:
32
+
Então defina outra variavel chamada`keys`:
34
33
```js
35
34
constkeys=Object.keys(car)
36
35
```
37
36
38
-
Use`console.log()`to print the `keys`variable to the terminal.
37
+
Utilize`console.log()`para imprimir a variavel `keys` no terminal.
39
38
40
-
Check to see if your program is correct by running this command:
39
+
Verifique se seu programa está correto executando este comando:
0 commit comments