Skip to content

Commit deeebea

Browse files
committed
Translation 117 - 126 to ko-KR
1 parent 1e8de5e commit deeebea

File tree

1 file changed

+313
-5
lines changed

1 file changed

+313
-5
lines changed

ko-KR/README-ko_KR.md

Lines changed: 313 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1320,7 +1320,7 @@ setInterval(() => console.log('Hi'), 1000);
13201320

13211321
#### 답: A
13221322

1323-
문자열은 반복 가능한 객체예요. 스프레드 연산자는 반복 가능한 객체의 모든 문자를 하나의 요소로 매핑해요.
1323+
문자열은 반복 가능한 객체예요. spread 연산자는 반복 가능한 객체의 모든 문자를 하나의 요소로 매핑해요.
13241324

13251325
</p>
13261326
</details>
@@ -1879,7 +1879,7 @@ console.log(admin);
18791879

18801880
#### 답: B
18811881

1882-
스프레드 연산자 `...` 를 사용해 객체를 결합할 수 있어요. 이것은 한 객체의 키/값 쌍을 복사본으로 만들어, 다른 객체에 추가해요. 이 경우, `user` 객체의 복사본을 만들어, `admin` 객체에 추가해요. `admin` 객체는 이제 복사된 키/값 쌍이 들어있고, 결과는 `{ admin: true, name: "Lydia", age: 21 }` 예요.
1882+
spread 연산자 `...` 를 사용해 객체를 결합할 수 있어요. 이것은 한 객체의 키/값 쌍을 복사본으로 만들어, 다른 객체에 추가해요. 이 경우, `user` 객체의 복사본을 만들어, `admin` 객체에 추가해요. `admin` 객체는 이제 복사된 키/값 쌍이 들어있고, 결과는 `{ admin: true, name: "Lydia", age: 21 }` 예요.
18831883

18841884
</p>
18851885
</details>
@@ -2918,7 +2918,7 @@ console.log(giveLydiaChocolate.prototype);
29182918
- C: `{ constructor: ...}` `{}`
29192919
- D: `{ constructor: ...}` `undefined`
29202920

2921-
<details><summary><b>Answer</b></summary>
2921+
<details><summary><b></b></summary>
29222922
<p>
29232923

29242924
#### 답: D
@@ -3010,7 +3010,7 @@ getItems(['banana', 'apple'], 'pear', 'orange');
30103010
function nums(a, b) {
30113011
if (a > b) console.log('a is bigger');
30123012
else console.log('b is bigger');
3013-
return
3013+
return;
30143014
a + b;
30153015
}
30163016

@@ -3497,7 +3497,7 @@ console.log(food);
34973497

34983498
#### 답: A
34993499

3500-
`info` 객체의 `favoriteFood` 속성 값을 피자 이모지 `'🍕'`으로 설정했어요. 문자는 원시 데이터 형이에요. JavaScript에서 원시 데이터 형은 참조로 상호 작용 하지 않아요.
3500+
`info` 객체의 `favoriteFood` 속성 값을 피자 이모지 `'🍕'`으로 설정했어요. 문자는 원시 데이터 형이에요. JavaScript에서 원시 데이터 형은 참조로 상호 작용 하지 않아요.
35013501

35023502
JavaScript에서, 원시 데이터 형은 (객체가 아닌 모든 것) __ 으로 상호 작용해요. 이 경우, `info` 객체의 `favoriteFood` 속성 값을 `food` 배열 안의 첫 번째 요소로 설정했어요. 이 경우 (`'🍕'`) 피자 이모지는 문자열이에요. 문자열은 원시 데이터 형이므로 값으로 상호 작용해요. (좀 더 알고싶다면 내 [블로그 포스트](https://www.theavocoder.com/complete-javascript/2018/12/21/by-value-vs-by-reference)를 참고하세요.)
35033503

@@ -3770,3 +3770,311 @@ console.log(person);
37703770

37713771
</p>
37723772
</details>
3773+
3774+
---
3775+
3776+
###### 117. 다음 선택지 중 어느 것이 `6`을 반환 할까요?
3777+
3778+
```javascript
3779+
function sumValues(x, y, z) {
3780+
return x + y + z;
3781+
}
3782+
```
3783+
3784+
- A: `sumValues([...1, 2, 3])`
3785+
- B: `sumValues([...[1, 2, 3]])`
3786+
- C: `sumValues(...[1, 2, 3])`
3787+
- D: `sumValues([1, 2, 3])`
3788+
3789+
<details><summary><b>답</b></summary>
3790+
<p>
3791+
3792+
#### 답: C
3793+
3794+
연산자 `...`를 사용하면, 반복 가능한 객체를 개별요소로 _spread_ 펼칠 수 있어요. `sumValues` 함수는 인수 3개를 받았어요: `x`, `y` 그리고 `z`. `...[1, 2, 3]``sumValues` 함수에 전달하면 `1, 2, 3` 가 될 거예요.
3795+
3796+
</p>
3797+
</details>
3798+
3799+
---
3800+
3801+
###### 118. 무엇이 출력 될까요?
3802+
3803+
```javascript
3804+
let num = 1;
3805+
const list = ['🥳', '🤠', '🥰', '🤪'];
3806+
3807+
console.log(list[(num += 1)]);
3808+
```
3809+
3810+
- A: `🤠`
3811+
- B: `🥰`
3812+
- C: `SyntaxError`
3813+
- D: `ReferenceError`
3814+
3815+
<details><summary><b>답</b></summary>
3816+
<p>
3817+
3818+
#### 답: B
3819+
3820+
`+=` 연산자를 사용하면, `num`의 값을 `1` 씩 증가시켜요. `num`은 초기값 `1`을 가지고 있어요, 그래서 `1 + 1``2`예요.`list` 배열의 2번째 인덱스 아이템은 🥰 예요, `console.log(list[2])` 는 🥰 을 출력해요.
3821+
3822+
</p>
3823+
</details>
3824+
3825+
---
3826+
3827+
###### 119. 무엇이 출력 될까요?
3828+
3829+
```javascript
3830+
const person = {
3831+
firstName: 'Lydia',
3832+
lastName: 'Hallie',
3833+
pet: {
3834+
name: 'Mara',
3835+
breed: 'Dutch Tulip Hound',
3836+
},
3837+
getFullName() {
3838+
return `${this.firstName} ${this.lastName}`;
3839+
},
3840+
};
3841+
3842+
console.log(person.pet?.name);
3843+
console.log(person.pet?.family?.name);
3844+
console.log(person.getFullName?.());
3845+
console.log(member.getLastName?.());
3846+
```
3847+
3848+
- A: `undefined` `undefined` `undefined` `undefined`
3849+
- B: `Mara` `undefined` `Lydia Hallie` `ReferenceError`
3850+
- C: `Mara` `null` `Lydia Hallie` `null`
3851+
- D: `null` `ReferenceError` `null` `ReferenceError`
3852+
3853+
<details><summary><b>답</b></summary>
3854+
<p>
3855+
3856+
#### 답: B
3857+
3858+
optional chaining 연산자 `?.`를 사용하면, 더 깊이 중첩된 값이 유효한지 여부를 더는 분명하게 확인하지 않아도 돼요.`undefined` 또는 `null` 값 (_nullish_) 속성에 접근 하려고 할 때, 표현식을 평가하지 않고 `undefined`을 반환해요.
3859+
3860+
`person.pet?.name`: `person`은 속성이름 `pet`을 가지고 있어요: `person.pet`은 nullish(null 또는 undefined)가 아니에요. `name`이라는 속성 이름을 가지고 있어, `Mara`를 반환해요.
3861+
`person.pet?.family?.name`: `person`은 속성이름 `pet`을 가지고 있어요: `person.pet`은 nullish가 아니에요. `pet`은 _not_ have a property called `family`라는 속성이 _없어요_, `person.pet.family`은 nullish예요. 표현식은 `undefined`을 반환해요.
3862+
`person.getFullName?.()`: `person`은 속성이름`getFullName`을 가지고 있어요: `person.getFullName()` 은 nullish기 아니고 호출 할 수 있어요, 따라서 `Lydia Hallie`을 반환해요.
3863+
`member.getLastName?.()`: `member`은 정의되지 않았어요: `member.getLastName()`은 nullish예요. 표현식은 `undefined`을 반환해요.
3864+
3865+
</p>
3866+
</details>
3867+
3868+
---
3869+
3870+
###### 120. 무엇이 출력 될까요?
3871+
3872+
```javascript
3873+
const groceries = ['banana', 'apple', 'peanuts'];
3874+
3875+
if (groceries.indexOf('banana')) {
3876+
console.log('We have to buy bananas!');
3877+
} else {
3878+
console.log(`We don't have to buy bananas!`);
3879+
}
3880+
```
3881+
3882+
- A: We have to buy bananas!
3883+
- B: We don't have to buy bananas
3884+
- C: `undefined`
3885+
- D: `1`
3886+
3887+
<details><summary><b>답</b></summary>
3888+
<p>
3889+
3890+
#### 답: B
3891+
3892+
if문에 조건 `groceries.indexOf("banana")`을 전달했어요. `groceries.indexOf("banana")``0`을 반환하고, 이건 거짓 같은 값이에요. if문의 조건이 거짓 같은 값이기 때문에, 코드는 `else` 블록을 실행하고, `We don't have to buy bananas!`이 출력돼요.
3893+
3894+
</p>
3895+
</details>
3896+
3897+
---
3898+
3899+
###### 121. 무엇이 출력 될까요?
3900+
3901+
```javascript
3902+
const config = {
3903+
languages: [],
3904+
set language(lang) {
3905+
return this.languages.push(lang);
3906+
},
3907+
};
3908+
3909+
console.log(config.language);
3910+
```
3911+
3912+
- A: `function language(lang) { this.languages.push(lang }`
3913+
- B: `0`
3914+
- C: `[]`
3915+
- D: `undefined`
3916+
3917+
<details><summary><b>답</b></summary>
3918+
<p>
3919+
3920+
#### 답: D
3921+
3922+
`language` 메소드는 `setter`예요. Setters는 실제 값을 유지하지 않아요, 그들의 목적은 속성을 _수정_ 하는 거예요. `setter` 메소드를 부르면, `undefined`가 반환돼요.
3923+
3924+
</p>
3925+
</details>
3926+
3927+
---
3928+
3929+
###### 122. 무엇이 출력 될까요?
3930+
3931+
```javascript
3932+
const name = 'Lydia Hallie';
3933+
3934+
console.log(!typeof name === 'object');
3935+
console.log(!typeof name === 'string');
3936+
```
3937+
3938+
- A: `false` `true`
3939+
- B: `true` `false`
3940+
- C: `false` `false`
3941+
- D: `true` `true`
3942+
3943+
<details><summary><b>답</b></summary>
3944+
<p>
3945+
3946+
#### 답: C
3947+
3948+
`typeof name`은 `"string"`을 반환해요. 문자열 `"string"`은 진짜 같은 값이고, `!typeof name`은 불리언 값 `false`을 반환해요. `false === "object"` 그리고 `false === "string"` 둘다 `false`을 반환해요.
3949+
3950+
(특정한 형과 같은지(다른지) 알고 싶다면, `!typeof` 대신 `!==`을 사용 해야 해요.)
3951+
3952+
</p>
3953+
</details>
3954+
3955+
---
3956+
3957+
###### 123. 무엇이 출력 될까요?
3958+
3959+
```javascript
3960+
const add = (x) => (y) => (z) => {
3961+
console.log(x, y, z);
3962+
return x + y + z;
3963+
};
3964+
3965+
add(4)(5)(6);
3966+
```
3967+
3968+
- A: `4` `5` `6`
3969+
- B: `6` `5` `4`
3970+
- C: `4` `function` `function`
3971+
- D: `undefined` `undefined` `6`
3972+
3973+
<details><summary><b>답</b></summary>
3974+
<p>
3975+
3976+
#### 답: A
3977+
3978+
`add`함수는 화살표 함수를 반환하는 함수를 반환하고, 반환한 함수는 화살표 함수를 반환하고, 반환한 함수는 화살표 함수를 반환해요(아직 나와 함께인가요?). 첫 번째 함수는 값이 `4`인 인수 `x`를 받아요. 값이 `5`인 인수 `y`를 받은 두 번째 함수를 호출해요. 그리고 우리는 값이 `6`인 인수 `z`를 받은 세 번째 함수를 호출해요. 값 `x`, `y` 그리고 `z`를 가진 마지막 화살표 함수에 접근하려고 할 때, JS 엔진은 그에 따른 값 `x` 그리고 `y`를 찾기 위해 스코프 체인을 올라가요. 이건 `4` `5` `6`을 반환해요.
3979+
3980+
</p>
3981+
</details>
3982+
3983+
---
3984+
3985+
###### 124. 무엇이 출력 될까요?
3986+
3987+
```javascript
3988+
async function* range(start, end) {
3989+
for (let i = start; i <= end; i++) {
3990+
yield Promise.resolve(i);
3991+
}
3992+
}
3993+
3994+
(async () => {
3995+
const gen = range(1, 3);
3996+
for await (const item of gen) {
3997+
console.log(item);
3998+
}
3999+
})();
4000+
```
4001+
4002+
- A: `Promise {1}` `Promise {2}` `Promise {3}`
4003+
- B: `Promise {<pending>}` `Promise {<pending>}` `Promise {<pending>}`
4004+
- C: `1` `2` `3`
4005+
- D: `undefined` `undefined` `undefined`
4006+
4007+
<details><summary><b>답</b></summary>
4008+
<p>
4009+
4010+
#### 답: C
4011+
4012+
제너레이터 함수 `range`은 range에 전달한 각각의 아이템에 promise를 가진 async 객체를 반환해요: `Promise{1}`, `Promise{2}`, `Promise{3}`. 변수 `gen`을 async 객체로 만들고, 그후에 `for await ... of` 루프를 사용해서 순환해요. 변수 `item`은 반환된 Promise 값 만들어요: 첫번째는 `Promise{1}`, 그다음은 `Promise{2}`, 그다음은 `Promise{3}`. `item`의 값인 프로미스를 resolved 하기 위해 _기다리고_, resolved 된 프로미스의 _값_ 은 반환돼요: `1`, `2`, 그리고 `3`.
4013+
4014+
</p>
4015+
</details>
4016+
4017+
---
4018+
4019+
###### 125. 무엇이 출력 될까요?
4020+
4021+
```javascript
4022+
const myFunc = ({ x, y, z }) => {
4023+
console.log(x, y, z);
4024+
};
4025+
4026+
myFunc(1, 2, 3);
4027+
```
4028+
4029+
- A: `1` `2` `3`
4030+
- B: `{1: 1}` `{2: 2}` `{3: 3}`
4031+
- C: `{ 1: undefined }` `undefined` `undefined`
4032+
- D: `undefined` `undefined` `undefined`
4033+
4034+
<details><summary><b>답</b></summary>
4035+
<p>
4036+
4037+
#### 답: D
4038+
4039+
`myFunc`는 속성 `x`, `y` 그리고 `z`를 속성으로 가진 객체가 인수라고 예상해요. `x`, `y` 그리고 `z`의 속성을 가진 하나의 객체({x: 1, y: 2, z: 3}) 대신, 분리된 숫자 값 (1, 2, 3)을 전달했기 때문에 `x`, `y` 그리고 `z`는 기본값 `undefined`을 가져요.
4040+
4041+
</p>
4042+
</details>
4043+
4044+
---
4045+
4046+
###### 126. 무엇이 출력 될까요?
4047+
4048+
```javascript
4049+
function getFine(speed, amount) {
4050+
const formattedSpeed = new Intl.NumberFormat('en-US', {
4051+
style: 'unit',
4052+
unit: 'mile-per-hour',
4053+
}).format(speed);
4054+
4055+
const formattedAmount = new Intl.NumberFormat('en-US', {
4056+
style: 'currency',
4057+
currency: 'USD',
4058+
}).format(amount);
4059+
4060+
return `The driver drove ${formattedSpeed} and has to pay ${formattedAmount}`;
4061+
}
4062+
4063+
console.log(getFine(130, 300));
4064+
```
4065+
4066+
- A: The driver drove 130 and has to pay 300
4067+
- B: The driver drove 130 mph and has to pay \$300.00
4068+
- C: The driver drove undefined and has to pay undefined
4069+
- D: The driver drove 130.00 and has to pay 300.00
4070+
4071+
<details><summary><b>답</b></summary>
4072+
<p>
4073+
4074+
#### 답: B
4075+
4076+
`Intl.NumberFormat` 메소드를 사용하면, 숫자 값을 원하는 로케일로 만들 수 있어요. 숫자 값 `130`을 `unit`이 `mile-per-hour`인 로케일 `en-US`로 만들면, `130 mph`가 돼요. 숫자 값 `300`을 `currency`가 `USD`인 로케일 `en-US`로 만들면 `$300.00`가 돼요.
4077+
4078+
</p>
4079+
</details>
4080+

0 commit comments

Comments
 (0)