[문서] C09 충돌 해결 및 미번역분 번역#1856
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
…rean Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
|
@hcy020817 리뷰 부탁드립니다 밑에 파일들 해주시면 됩니다!
|
hcy020817
left a comment
There was a problem hiding this comment.
안녕하세요! 파일 수가 많고 초반 충돌 정리량도 꽤 많았는데 작업하시느라 정말 고생 많으셨습니다. 전체적으로 충돌 마커 정리나 문서 흐름은 잘 처리되어 있었습니다.
다만 리뷰하면서 아래와 같은 부분들이 몇 군데 보여 코멘트 남겼습니다.
-번역이 누락된 부분, 원문과 줄 바꿈이 달라진 부분, 원문에서는 삭제되었지만 한글 버전에는 남아 있는 내용
반복적으로 나타나는 유형이라 동일한 내용의 코멘트가 너무 많아지지 않도록, 처음 등장하는 부분들 위주로만 표시해두었습니다. 확인 부탁드립니다!
| <<<<<<< HEAD | ||
| 자바스크립트는 객체 프로퍼티 키로 오직 문자형과 심볼형만을 허용합니다. 숫자형, 불린형 모두 불가능하고 오직 문자형과 심볼형만 가능하죠. | ||
|
|
||
| 지금까지는 프로퍼티 키가 문자형인 경우만 살펴보았습니다. 이번 챕터에선 프로퍼티 키로 심볼값을 사용해 보면서, 심볼형 키를 사용할 때의 이점에 대해 살펴보도록 하겠습니다. |
There was a problem hiding this comment.
이 문장이 원문에서는 삭제된 문장인 것 같습니다. 확인 한번 부탁드립니다.
| ``` | ||
|
|
||
| It works, there's no error... But it's quite inelegant. As you can see, the `"user.address"` appears twice in the code. | ||
| 에러 없이 잘 동작하네요. 하지만 코드가 꽤 볼품없습니다. 보시다시피 "user.address"가 코드에 두 번이나 등장합니다. |
| >>>>>>> upstream/master | ||
| 즉, `value?.prop`은 다음과 같이 평가됩니다. | ||
|
|
||
| * `value`가 존재하면 `value.prop`처럼 동작합니다. |
| ======= | ||
| E.g. in `user?.address.street.name` the `?.` allows `user` to safely be `null/undefined` (and returns `undefined` in that case), but that's only for `user`. Further properties are accessed in a regular way. If we want some of them to be optional, then we'll need to replace more `.` with `?.`. | ||
| >>>>>>> upstream/master |
| `?.`은 `?.`왼쪽 평가대상이 없어도 괜찮은 경우에만 선택적으로 사용해야 합니다. | ||
|
|
||
| 꼭 있어야 하는 값인데 없는 경우에 `?.`을 사용하면 프로그래밍 에러를 쉽게 찾을 수 없으므로 이런 상황을 만들지 말도록 합시다. |
| `obj1 + obj2` 처럼 객체끼리 더하는 연산을 하거나, `obj1 - obj2` 처럼 객체끼리 빼는 연산을 하면 어떤 일이 일어날까요? `alert(obj)`로 객체를 출력할 때는 무슨 일이 발생할까요? | ||
|
|
||
| <<<<<<< HEAD | ||
| 이 모든 경우에 자동 형 변환이 일어납니다. 객체는 원시값으로 변환되고, 그 후 의도한 연산이 수행됩니다. |
There was a problem hiding this comment.
원문에 대한 번역된 문장들을 아래에 추가하셨으니까 이 문장은 삭제해도 될 것 같습니다.
|
Please make the requested changes. After it, add a comment "/done". |
1 similar comment
|
Please make the requested changes. After it, add a comment "/done". |
|
Please make the requested changes. After it, add a comment "/done". |
1 similar comment
|
Please make the requested changes. After it, add a comment "/done". |
jjyy0804
left a comment
There was a problem hiding this comment.
1-js/04-object-basics/06-constructor-new/1-two-functions-one-object/task.md
1-js/04-object-basics/06-constructor-new/2-calculator-constructor/task.md
1-js/04-object-basics/06-constructor-new/article.md
위 의 파일 확인 후 수정이 필요해보이는 부분 리뷰 코멘트 달아두었습니다!
| 이제 막 자바스크립트를 배우기 시작했다면 옵셔널 체이닝이 등장하게 된 배경 상황을 직접 겪어보지 않았을 겁니다. 몇 가지 사례를 재현하면서 왜 옵셔널 체이닝이 등장했는지 알아봅시다. | ||
|
|
||
| <<<<<<< HEAD | ||
| 사용자가 여러 명 있는데 그중 몇 명은 주소 정보를 가지고 있지 않다고 가정해봅시다. 이럴 때 `user.address.street`를 사용해 주소 정보에 접근하면 에러가 발생할 수 있습니다. |
|
|
||
| - `value`가 존재하면 `value.prop`처럼 동작합니다. | ||
|
|
||
| - 그렇지 않은 경우(`value`가 `undefined`나 `null`일 때)에는 `undefined`를 반환합니다. | ||
|
|
| ======= | ||
| So, if there are any further function calls or operations to the right of `?.`, they won't be made. | ||
|
|
||
| For instance: |
| <<<<<<< HEAD | ||
| let user2 = null; // user2는 권한이 없는 사용자라고 가정해봅시다. | ||
|
|
||
| let key = "firstName"; |
| let user = null; | ||
|
|
||
| user?.name = "John"; // Error, doesn't work | ||
| // because it evaluates to: undefined = "John" | ||
| ``` | ||
|
|
||
| ```` | ||
|
|
||
| ## Summary | ||
|
|
| In other words, `e` multiplies the number by `1` with the given zeroes count. | ||
|
|
||
| ```js | ||
| 1e3 === 1 * 1000; // e3 means *1000 | ||
| 1.23e6 === 1.23 * 1000000; // e6 means *1000000 | ||
| ``` |
| 일반적인 숫자 검사의 경우: | ||
|
|
||
| - `isNaN(value)`은 인수를 숫자로 변환한 다음 `NaN`인지 검사합니다. | ||
|
|
||
| - `Number.isNaN(value)`은 인수가 숫자형인지 확인하고, 맞다면 `NaN`인지 검사합니다. | ||
|
|
||
| - `isNaN(value)` converts its argument to a number and then tests it for being `NaN` | ||
| - `Number.isNaN(value)` checks whether its argument belongs to the `number` type, and if so, tests it for being `NaN` | ||
| - `isFinite(value)` converts its argument to a number and then tests it for not being `NaN/Infinity/-Infinity` | ||
| - `Number.isFinite(value)` checks whether its argument belongs to the `number` type, and if so, tests it for not being `NaN/Infinity/-Infinity` | ||
| - `isFinite(value)`은 인수를 숫자로 변환한 다음 `NaN/Infinity/-Infinity`가 아닌지 검사합니다. |
| 3. Otherwise if hint is `"number"` or `"default"` | ||
| - try calling `obj.valueOf()` or `obj.toString()`, whatever exists. | ||
|
|
||
| All these methods must return a primitive to work (if defined). |
| 3. 1과 2에 해당하지 않고, hint가 `"number"`나 `"default"`라면 | ||
| - `obj.valueOf()`나 `obj.toString()`을 호출합니다. | ||
|
|
||
| `obj.toString()`만 사용해도 '모든 변환'을 다 다룰 수 있기 때문에, 실무에선 `obj.toString()`만 구현해도 충분한 경우가 많습니다. 반환 값도 '사람이 읽고 이해할 수 있는' 형식이기 때문에 실용성 측면에서 다른 메서드에 뒤처지지 않습니다. `obj.toString()`은 로깅이나 디버깅 목적으로도 자주 사용됩니다. |
There was a problem hiding this comment.
"이 메서드는 로그 출력이나 디버깅 용도로 사용할 수 있는, 사람이 읽기 쉬운 형태의 객체 표현을 반환해야 합니다." 이렇게 번역하는 것이 자연스러울 것 같은데 확인 부탁 드립니다.
| ======= | ||
| The optional chaining `?.` is a safe way to access nested object properties, even if an intermediate property doesn't exist. | ||
|
|
||
| ## The "non-existing property" problem |
|
Please make the requested changes. After it, add a comment "/done". |
3 similar comments
|
Please make the requested changes. After it, add a comment "/done". |
|
Please make the requested changes. After it, add a comment "/done". |
|
Please make the requested changes. After it, add a comment "/done". |
요약
번역 범위
1-js/04-object-basics/04-object-methods— article.md1-js/04-object-basics/06-constructor-new— article.md, task.md 2개1-js/04-object-basics/07-optional-chaining— article.md1-js/04-object-basics/08-symbol— article.md1-js/04-object-basics/09-object-toprimitive— article.md1-js/05-data-types/01-primitives-methods— article.md, task.md 1개1-js/05-data-types/02-number— article.md, solution.md 1개연관 이슈
(fix #일이삼)
Pull Request 체크리스트
TODO