-
Notifications
You must be signed in to change notification settings - Fork 853
[문서] C12 충돌 해결 #1857
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 2026-en-merge
Are you sure you want to change the base?
[문서] C12 충돌 해결 #1857
Changes from all commits
f52b77e
79aa289
74d76a4
32b46e0
620a964
b3fa53b
3c8363c
e7b5797
9cd1f5e
e8c94f4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,11 +23,7 @@ function sum(a, b) { | |
| alert( sum(1, 2, 3, 4, 5) ); | ||
| ``` | ||
|
|
||
| <<<<<<< HEAD | ||
| 함수를 정의할 땐 인수를 두 개만 받도록 하고, 실제 함수를 호출할 땐 이보다 더 많은 '여분의' 인수를 전달했지만, 에러가 발생하지 않았습니다. 다만 반환 값은 처음 두 개의 인수만을 사용해 계산됩니다. | ||
| ======= | ||
| There will be no error because of "excessive" arguments. But of course in the result only the first two will be counted, so the result in the code above is `3`. | ||
| >>>>>>> upstream/master | ||
| 함수를 정의할 땐 인수를 두 개만 받도록 하고, 실제 함수를 호출할 땐 이보다 더 많은 '여분의' 인수를 전달했지만, 에러가 발생하지 않았습니다. 다만 결과를 계산할 때는 처음 두 개의 인수만 사용하므로 위 코드의 결과는 `3`이 됩니다. | ||
|
|
||
| 이렇게 여분의 매개변수는 그 값들을 담을 배열 이름을 마침표 세 개 `...`뒤에 붙여주면 함수 선언부에 포함시킬 수 있습니다. 이때 마침표 세 개 `...`는 "남아있는 매개변수들을 한데 모아 배열에 집어넣어라."는 것을 의미합니다. | ||
|
|
||
|
|
@@ -229,28 +225,19 @@ alert( Array.from(str) ); // H,e,l,l,o | |
| 이런 이유때문에 무언가를 배열로 바꿀 때는 전개 구문보다 `Array.from`이 보편적으로 사용됩니다. | ||
|
|
||
|
|
||
| <<<<<<< HEAD | ||
| ## 배열과 객체의 복사본 만들기 | ||
| ======= | ||
| ## Copy an array/object | ||
| >>>>>>> upstream/master | ||
|
|
||
| [참조에 의한 객체 복사](info:object-copy#cloning-and-merging-object-assign) 챕터에서 `Object.assign()`을 사용해 객체를 복사한 예시를 떠올려봅시다. | ||
|
|
||
| `Object.assign()` 말고도 스프레드 문법을 사용하면 배열과 객체를 복사할 수 있습니다. | ||
|
|
||
| ```js run | ||
| let arr = [1, 2, 3]; | ||
| <<<<<<< HEAD | ||
| let arrCopy = [...arr]; // 배열을 펼쳐서 각 요소를 분리후, 매개변수 목록으로 만든 다음에 | ||
| // 매개변수 목록을 새로운 배열에 할당함 | ||
| ======= | ||
|
|
||
| *!* | ||
| let arrCopy = [...arr]; // spread the array into a list of parameters | ||
| // then put the result into a new array | ||
| let arrCopy = [...arr]; // 배열을 펼쳐서 각 요소를 분리후, 매개변수 목록으로 만든 다음에 | ||
| // 매개변수 목록을 새로운 배열에 할당함 | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 맞춤법상 '분리 후'가 맞는 표현으로 수정해야 할 것 같습니다. |
||
| */!* | ||
| >>>>>>> upstream/master | ||
|
|
||
| // 배열 복사본의 요소가 기존 배열 요소와 진짜 같을까요? | ||
| alert(JSON.stringify(arr) === JSON.stringify(arrCopy)); // true | ||
|
|
@@ -268,16 +255,11 @@ alert(arrCopy); // 1, 2, 3 | |
|
|
||
| ```js run | ||
| let obj = { a: 1, b: 2, c: 3 }; | ||
| <<<<<<< HEAD | ||
| let objCopy = { ...obj }; // 객체를 펼쳐서 각 요소를 분리후, 매개변수 목록으로 만든 다음에 | ||
| // 매개변수 목록을 새로운 객체에 할당함 | ||
| ======= | ||
|
|
||
| *!* | ||
| let objCopy = { ...obj }; // spread the object into a list of parameters | ||
| // then return the result in a new object | ||
| let objCopy = { ...obj }; // 객체를 펼쳐서 각 요소를 분리후, 매개변수 목록으로 만든 다음에 | ||
| // 매개변수 목록을 새로운 객체에 할당함 | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 위와 동일한 의견입니다. |
||
| */!* | ||
| >>>>>>> upstream/master | ||
|
|
||
| // 객체 복사본의 프로퍼티들이 기존 객체의 프로퍼티들과 진짜 같을까요? | ||
| alert(JSON.stringify(obj) === JSON.stringify(objCopy)); // true | ||
|
|
@@ -291,11 +273,7 @@ alert(JSON.stringify(obj)); // {"a":1,"b":2,"c":3,"d":4} | |
| alert(JSON.stringify(objCopy)); // {"a":1,"b":2,"c":3} | ||
| ``` | ||
|
|
||
| <<<<<<< HEAD | ||
| 이렇게 전개 구문을 사용하면 `let objCopy = Object.assign({}, obj);`, `let arrCopy = Object.assign([], arr);`보다 더 짧은 코드로 배열이나 객체를 복사할 수 있어서 사람들은 이 방법을 선호합니다. | ||
| ======= | ||
| This way of copying an object is much shorter than `let objCopy = Object.assign({}, obj)` or for an array `let arrCopy = Object.assign([], arr)` so we prefer to use it whenever we can. | ||
| >>>>>>> upstream/master | ||
|
|
||
|
|
||
| ## 요약 | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
뒤 문장 번역해 주신 부분은 잘 해주신 거 같은데 앞 문장이 '여분의' 이 부분이 잘드러나고 간략하면 좋을 거 같은데 아래와 같은 표현은 어떠신가요?
'여분의' 인수가 있어도 에러는 발생하지 않습니다. 다만 결과를 계산할 때는 처음 두 개의 인수만 사용하므로 위 코드의 결과는 '3'이 됩니다.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
저도 처음에는 그렇게 생각했는데 이전에 번역하신 분이 앞의 내용까지 고려해서 지금처럼 번역을 해주신 것 같더라구요.
앞서 번역을 해주신 분의 의도가 저는 해석하는 데에 있어서 더 좋다고 판단되어서 이전의 번역을 최대한 건들지 않고 뒷 문장만 번역을 추가하려고 해서 지금과 같은 번역이 완성 되었습니다.
앞에 실제 예시로 함수 SUM에 인수를 2개 넣도록 선언하고 5개의 인수를 넣는 예시가 있는데 이러한 예시를 고려한 한글 번역이 영어 번역보다 더 적절하다고 생각해서 이렇게 번역을 유지했습니다.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
처음 읽는 사람 관점에서 코드의 맥락도 생각하면 기존 번역이 자연스러운 거 같네요!
그럼 리뷰 완료하겠습니다