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_uk.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.
37
+
Використовуйте`console.log()`для друку змінної`keys`до терміналу.
39
38
40
-
Check to see if your program is correct by running this command:
39
+
Перевірте, чи правильно працює ваша програма, виконавши цю команду:
0 commit comments