Skip to content

Commit d39a0a0

Browse files
committed
[docs] 05-data-types/09-keys-values-entries 충돌 해결 및 번역
1 parent 75224bf commit d39a0a0

1 file changed

Lines changed: 4 additions & 19 deletions

File tree

  • 1-js/05-data-types/09-keys-values-entries

1-js/05-data-types/09-keys-values-entries/article.md

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -76,15 +76,9 @@ for (let value of Object.values(user)) {
7676

7777
하지만 `Object.entries``Object.fromEntries`를 순차적으로 적용하면 객체에도 배열 전용 메서드 사용할 수 있습니다. 적용 방법은 다음과 같습니다.
7878

79-
<<<<<<< HEAD
8079
1. `Object.entries(obj)`를 사용해 객체의 키-값 쌍이 요소인 배열을 얻습니다.
81-
2. 1.에서 만든 배열에 `map` 등의 배열 전용 메서드를 적용합니다.
80+
2. 1.에서 만든 배열에 `map` 등의 배열 전용 메서드를 적용해 키-값 쌍을 변환합니다.
8281
3. 2.에서 반환된 배열에 `Object.fromEntries(array)`를 적용해 배열을 다시 객체로 되돌립니다.
83-
=======
84-
1. Use `Object.entries(obj)` to get an array of key/value pairs from `obj`.
85-
2. Use array methods on that array, e.g. `map`, to transform these key/value pairs.
86-
3. Use `Object.fromEntries(array)` on the resulting array to turn it back into an object.
87-
>>>>>>> upstream/master
8882

8983
이 방법을 사용해 가격 정보가 저장된 객체 prices의 프로퍼티 값을 두 배로 늘려보도록 합시다.
9084

@@ -97,22 +91,13 @@ let prices = {
9791

9892
*!*
9993
let doublePrices = Object.fromEntries(
100-
<<<<<<< HEAD
101-
// 객체를 배열로 변환해서 배열 전용 메서드인 map을 적용하고 fromEntries를 사용해 배열을 다시 객체로 되돌립니다.
102-
Object.entries(prices).map(([key, value]) => [key, value * 2])
103-
=======
104-
// convert prices to array, map each key/value pair into another pair
105-
// and then fromEntries gives back the object
94+
// prices 객체를 배열로 변환하고 각 키-값 쌍에 map을 적용해 새로운 쌍으로 만듭니다.
95+
// 그런 다음 fromEntries를 사용해 배열을 다시 객체로 되돌립니다.
10696
Object.entries(prices).map(entry => [entry[0], entry[1] * 2])
107-
>>>>>>> upstream/master
10897
);
10998
*/!*
11099

111100
alert(doublePrices.meat); // 8
112101
```
113102

114-
<<<<<<< HEAD
115-
지금 당장은 어렵게 느껴지겠지만 한두 번 위 방법을 적용해 보면 객체에 배열 전용 메서드를 적용하는게 쉬워질 겁니다.
116-
=======
117-
It may look difficult at first sight, but becomes easy to understand after you use it once or twice. We can make powerful chains of transforms this way.
118-
>>>>>>> upstream/master
103+
지금 당장은 어렵게 느껴지겠지만 한두 번 위 방법을 적용해 보면 객체에 배열 전용 메서드를 적용하는게 쉬워질 겁니다. 이러한 방법으로 변환에 대한 강력한 체인을 만들 수 있습니다.

0 commit comments

Comments
 (0)