Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions i18n/ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
, "LOOPING THROUGH ARRAYS": "배열을 루프하기"
, "OBJECTS": "객체"
, "OBJECT PROPERTIES": "객체 속성"
, "OBJECT KEYS": "객체 키"
, "FUNCTIONS": "함수"
, "FUNCTION ARGUMENTS": "함수 인자"
, "SCOPE": "스코프"
Expand Down
20 changes: 9 additions & 11 deletions problems/object-keys/problem_ko.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
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.
자바스크립트에서는 `Object.keys()`로 객체의 키를 배열로 가져올 수 있습니다. 이 배열을 순회하면 각 키에 해당하는 속성값을 읽거나 바꿀 수 있습니다.

Here's an example of listing all object keys using the **Object.keys()**
prototype method.
다음 예제는 자동차를 나타내는 객체에서 키를 가져옵니다.

```js
const car = {
Expand All @@ -14,13 +13,11 @@ const keys = Object.keys(car)
console.log(keys)
```

The above code will print an array of strings, where each string is a key in the car object. `['make', 'model', 'year']`
위 코드는 `['make', 'model', 'year']`를 출력합니다. 배열의 각 문자열은 `car` 객체의 키입니다.

## The challenge:
## 도전 과제

Create a file named `object-keys.js`.

In that file, define a variable named `car` like this:
`object-keys.js` 파일을 만드세요. 파일 안에 다음과 같이 `car` 변수를 선언하세요.

```js
const car = {
Expand All @@ -30,14 +27,15 @@ const car = {
}
```

Then define another variable named `keys` like this:
이어서 `keys` 변수를 선언하고 `car`의 키를 저장하세요.

```js
const keys = Object.keys(car)
```

Use `console.log()` to print the `keys` variable to the terminal.
`console.log()`로 `keys`를 터미널에 출력하세요.

Check to see if your program is correct by running this command:
다음 명령을 실행해 프로그램이 올바르게 동작하는지 확인하세요.

```bash
javascripting verify object-keys.js
Expand Down
8 changes: 4 additions & 4 deletions problems/object-keys/solution_ko.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---

# CORRECT.
# 정답입니다!

Good job using the Object.keys() prototype method. Remember to use it when you need to list the keys of an object.
`Object.keys(car)`로 자동차 객체의 키를 배열에 담았습니다. 다른 객체의 키가 필요할 때도 같은 메서드를 사용할 수 있습니다.

The next challenge is all about **functions**.
다음 과제는 **함수**에 관한 것입니다.

Run `javascripting` in the console to choose the next challenge.
터미널에서 `javascripting`을 실행해 다음 과제를 선택하세요.

---