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_ru.md
+8-9Lines changed: 8 additions & 9 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 предоставляет собственный способ перечисления всех доступных ключей объекта. Это может быть полезно для перебора всех свойств объекта и соответственно манипулирования их значениями.
2
2
3
-
Here's an example of listing all object keys using the **Object.keys()**
4
-
prototype method.
3
+
Вот пример перечисления всех ключей объекта с использованием метода-прототипа **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
+
Код выше выведет массив строк, где каждая строка - ключ в объекте "авто". `['make', 'model', 'year']`
18
17
19
18
## The challenge:
20
19
21
-
Create a file named`object-keys.js`.
20
+
Создайте файл с именем`object-keys.js`.
22
21
23
-
In that file, define a variable named`car`like this:
22
+
В этом файле объявите переменную с именем`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
+
Затем объявите другую переменную с именем `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.
0 commit comments