- Notifications
You must be signed in to change notification settings - Fork846
1-js/09-classes/06-instanceof 번역 완료#342
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
``` | ||
2.Most classes do not have`Symbol.hasInstance`. In that case, the standard logic is used:`obj instanceOf Class` checks whether`Class.prototype` equals to one of prototypes in the `obj` prototype chain. | ||
2.대부분 클래스들은`Symbol.hasInstance`를 가지고 있지 않습니다. 이번의 경우, 일반적인 로직을 사용되어질 것입니다.`obj instanceOf Class`는`Class.prototype`이 `obj` 프로토 체인 내부의 프로토타입 중 하나와 같은지 확인합니다. |
JuYeong0413Oct 27, 2019 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
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.
2. 대부분클래스들은`Symbol.hasInstance`를 가지고 있지 않습니다.이번의 경우, 일반적인로직을 사용되어질 것입니다.`obj instanceOf Class`는`Class.prototype`이`obj` 프로토 체인 내부의 프로토타입 중 하나와 같은지 확인합니다. | |
2. 대부분클래스는`Symbol.hasInstance`를 가지고 있지 않습니다.이러한 경우, 일반적인로직이 사용될 것입니다.`obj instanceOf Class`는`Class.prototype`이`obj` 프로토 체인 내부의 프로토타입 중 하나와 같은지 확인합니다. |
수정 제안 드려봅니다.
```js | ||
obj.__proto__ === Class.prototype? | ||
obj.__proto__.__proto__ === Class.prototype? | ||
obj.__proto__.__proto__.__proto__ === Class.prototype? | ||
... | ||
// if any answer is true, return true | ||
// otherwise, if we reached the end of the chain, return false | ||
// 이 중 하나라도 true라면 true를 리턴합니다 |
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.
// 이 중 하나라도 true라면 true를 리턴합니다 | |
// 이 중 하나라도 true라면 true를 리턴합니다. |
//if any answer is true, return true | ||
//otherwise, if we reached the end of the chain, return false | ||
//이 중 하나라도 true라면 true를 리턴합니다 | ||
//다시말하면, 위의 해당되는 것이 하나도 없다면 false 입니다. 그말은 프르토 체인의 끝에 도달한다는 것을 의미합니다 |
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.
//다시말하면, 위의 해당되는 것이 하나도 없다면 false 입니다.그말은 프르토체인의 끝에 도달한다는 것을 의미합니다 | |
//다시 말하면, 위의 해당되는 것이 하나도 없다면 false 입니다.그 말은 프로토체인의 끝에 도달한다는 것을 의미합니다. |
 | ||
By the way, there's also a method[objA.isPrototypeOf(objB)](mdn:js/object/isPrototypeOf), that returns `true` if `objA` is somewhere in the chain of prototypes for `objB`. So the test of `obj instanceof Class` can be rephrased as `Class.prototype.isPrototypeOf(obj)`. | ||
그런데, `objA`가 `objB`의 프로토타입의 체인 어딘가에 있다면, `true`를 리턴하는[objA.isPrototypeOf(objB)](mdn:js/object/isPrototypeOf) 라는 메서드가 있습니다. |
JuYeong0413Oct 27, 2019 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
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.
그런데,`objA`가`objB`의 프로토타입의 체인 어딘가에 있다면,`true`를 리턴하는[objA.isPrototypeOf(objB)](mdn:js/object/isPrototypeOf)라는 메서드가 있습니다. | |
그런데,`objA`가`objB`의 프로토타입의 체인 어딘가에 있다면,`true`를 리턴하는[objA.isPrototypeOf(objB)](mdn:js/object/isPrototypeOf)라는 메서드가 있습니다. |
It's funny, but the`Class`constructor itself does not participate in the check! Only the chain of prototypes and`Class.prototype` matters. | ||
`Class`생성자 그 자체는 확인할 수 없지만, 오직 프르토타입 체인과`Class.prototype`은 매우 중요하므로 확인해야 합니다. |
JuYeong0413Oct 27, 2019 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
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.
`Class` 생성자 그 자체는 확인할 수 없지만, 오직 프르토타입 체인과`Class.prototype`은 매우 중요하므로 확인해야 합니다. | |
`Class` 생성자 그 자체는 확인할 수 없지만, 오직 프르토타입 체인과`Class.prototype`은 매우 중요하므로 확인해야 합니다. |
문장 끝에 공백이 들어가 있습니다.
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.
리뷰사항 반영해주세요.
That can lead to interesting consequences when`prototype` property is changed after the object is created. | ||
언제`prototype`프로퍼티가 객체가 생성된 후에 변화되는지, 흥미로운 결과를 이끌어 낼수 있습니다. |
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.
언제`prototype`프로퍼티가 객체가 생성된 후에 변화되는지, 흥미로운 결과를 이끌어 낼수 있습니다. | |
언제`prototype`프로퍼티가 객체가 생성된 후에 변화되는지, 흥미로운 결과를 이끌어 낼수 있습니다. |
By [specification](https://tc39.github.io/ecma262/#sec-object.prototype.tostring), the built-in `toString` can be extracted from the object and executed in the context of any other value. And its result depends on that value. | ||
[이곳](https://tc39.github.io/ecma262/#sec-object.prototype.tostring)에 명시되어 있듯이, r객체와 실행중인 다른 값의 컨텍스트로부터 내장함수 `toString`을 사용하여 추출할 수 있습니다. 그리고 그 결과는 그 값에 의존합니다. |
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.
[이곳](https://tc39.github.io/ecma262/#sec-object.prototype.tostring)에 명시되어 있듯이,r객체와 실행중인 다른 값의 컨텍스트로부터 내장함수`toString`을 사용하여 추출할 수 있습니다. 그리고 그 결과는 그 값에 의존합니다. | |
[이곳](https://tc39.github.io/ecma262/#sec-object.prototype.tostring)에 명시되어 있듯이,객체와 실행중인 다른 값의 컨텍스트로부터 내장함수`toString`을 사용하여 추출할 수 있습니다. 그리고 그 결과는 그 값에 의존합니다. |
```js run | ||
```js run |
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.
```js run | |
```js run |
```js run | ||
```js run: |
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.
```js run: | |
```js run |
## Summary | ||
##요약 |
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.
##요약 | |
##요약 |
At the end we have "typeof on steroids" that not only works for primitive data types, but also for built-in objects and even can be customized. | ||
끝으로 우리가 원시적인 데이터 타입으로 동작할 뿐 아니라, 내장된 오브젝트를 위한 "typeof on steroids"를 가지고 있고 심지어 커스텀도 가능합니다. |
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.
끝으로 우리가 원시적인 데이터 타입으로 동작할 뿐 아니라, 내장된오브젝트를 위한 "typeof on steroids"를 가지고 있고 심지어 커스텀도 가능합니다. | |
끝으로 우리가 원시적인 데이터 타입으로 동작할 뿐 아니라, 내장된객체를 위한 "typeof on steroids"를 가지고 있고 심지어 커스텀도 가능합니다. |
”typeof on steroids”
번역 누락object
는객체
로 번역합니다. 용어집 확인해주세요.- 번역 시
우리
라는 표현은 사용하지 않는 것으로 알고있습니다.
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.
- Files changed에서 확인해보면 과제 글이 삭제되었다고 나오는데 확인 부탁드립니다.(instanceof 본문만 있어야 합니다.)
- 커밋을 하나로 합쳐주시고, 커밋메세지 컨벤션을 따라주세요.
- Pull Request 체크리스트 확인해주시고, 검토하신 사항은 TODO에 체크 부탁드립니다.
- 계속 PR을 생성하고 계신데, 이력 추적을 위해 한 PR에서 작업해주세요.참고
죄송합니다 이번꺼는.. 과거로 돌아가다가 실수로 닫아버렸습니다. 새로 올려도 괜찮을까요? ㅠ
JuYeong0413 commentedOct 27, 2019 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
|
b22fd58
to7f4b439
CompareMalgus1995 commentedOct 27, 2019 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
파일 삭제는 제가 다른분꺼까지 실수로 번역해서 다급하게 지워서 과거로 돌려서 복구했습니다.. |
d20ae00
to51c3e7a
CompareSuch a check may be necessary in many cases, here we'll use it for building a *polymorphic* function, the one that treats arguments differently depending on their type. | ||
확인하는 기능은 많은 경우에서 필수적인데, 여기에 매개변수의 타입에 의해 처리하는 법이 달라지는 다형적인 함수를 빌드하기 위해 사용할 것입니다. |
Violet-Bora-LeeOct 28, 2019 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
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.
polymorphic 을 둘러싸고있는 별표를 지우셨네요.
특수문자는 마음대로 지우시면 안됩니다.
컨벤션 숙지하셨다고 체크하셨는데, 다시 확인해주세요.
https://gist.github.com/ihoneymon/652be052a0727ad59601
마크다운 사용법을 확인부탁드립니다.
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.
피드백 감사합니다. 몇개 지운것들 다시 추가했습니다.
javascript-translate-bot commentedOct 28, 2019
Please make the requested changes. After it, add a comment "/done". |
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.
리뷰 남긴것 반영이 안되어있는게 있습니다.
마지막으로 원문 없이, 번역하신 글 읽어보시고 이해 되나 확인 부탁드려요.
독자들은 원문 없이 번역하신 글만 읽게됩니다. 다른사람들이 내가 번역한 글을 읽고 이해할 수 있을까? 라고 생각하시면서 최종 검토부탁드립니다.
가독성이 떨어지는 문장들을 제가 일일히 수정해드리기에는 시간이 너무 오래 걸리고, 그 시간이면 제가 처음부터 번역을 하는게 더 빨라서요.
퇴고 꼭!! 꼼꼼히 부탁드립니다.
```js run | ||
*!* | ||
//instead of class | ||
//함수 Rabbit |
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.
원문이instead of class
인데,함수 Rabbit
로 번역하신 이유가 있을까요?
It's funny, but the`Class`constructor itself does not participate in the check! Only the chain of prototypes and`Class.prototype` matters. | ||
`Class`생성자 그 자체는 확인할 수 없지만, 오직 프르토타입 체인과`Class.prototype`은 매우 중요하므로 확인해야 합니다. |
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.
리뷰사항 반영해주세요.
javascript-translate-bot commentedOct 28, 2019
Please make the requested changes. After it, add a comment "/done". |
94fede9
to5afd4dd
Compare충돌발생한거 해결해주세요. |
7a7c6a3
to2748bd7
Compare커밋 메시지 수정 부탁드립니다. |
293c5a2
to029337e
Compare완료했습니다. |
감사합니다. 머지 진행하겠습니다 👍 👍 👍 |
|
-#342 리뷰- 맞춤법검사 안함- 일부 문장 번역 안됨
- Object.prototype.toString 부분 보완 필요함-#342
Uh oh!
There was an error while loading.Please reload this page.
Pull Request 체크리스트
TODO
감사합니다!