Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Merged

Conversation

Malgus1995
Copy link
Contributor

@Malgus1995Malgus1995 commentedOct 27, 2019
edited
Loading

Pull Request 체크리스트

TODO

  • 번역 규칙을 확인하셨나요?
    • 줄 바꿈과 단락을 '원문과 동일하게' 유지하셨나요?
    • 맞춤법 검사기로 맞춤법을 확인하셨나요?
    • 공백(스페이스), 큰따옴표("), 작은따옴표('), 대시(-), 백틱(`)을 비롯한 모든 특수문자는 그대로 두셨나요?
  • 로컬 서버 세팅 후 최종 결과물을 확인해 보셨나요?
  • PR 하나엔 번역문 하나만 넣으셨나요?
  • 의미 있는 커밋 메시지를 작성하셨나요?
    • 예시
      • [프락시] 번역
      • [프락시] 과제 번역
      • [if문과 조건부 연산자 '?'] 리뷰
      • [주석] 2차 리뷰
      • [Date 객체와 날짜] 번역

감사합니다!

```

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` 프로토 체인 내부의 프로토타입 중 하나와 같은지 확인합니다.
Copy link
Contributor

@JuYeong0413JuYeong0413Oct 27, 2019
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Suggested change
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를 리턴합니다
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Suggested change
// 이 중 하나라도 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 입니다. 그말은 프르토 체인의 끝에 도달한다는 것을 의미합니다
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Suggested change
//다시말하면, 위의 해당되는 것이 하나도 없다면 false 입니다.그말은 프르토체인의 끝에 도달한다는 것을 의미합니다
//다시 말하면, 위의 해당되는 것이 하나도 없다면 false 입니다.그 말은 프로토체인의 끝에 도달한다는 것을 의미합니다.


![](instanceof.svg)

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) 라는 메서드가 있습니다.
Copy link
Contributor

@JuYeong0413JuYeong0413Oct 27, 2019
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Suggested change
그런데,`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`은 매우 중요하므로 확인해야 합니다.
Copy link
Contributor

@JuYeong0413JuYeong0413Oct 27, 2019
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Suggested change
`Class` 생성자 그 자체는 확인할 수 없지만, 오직 프르토타입 체인과`Class.prototype`은 매우 중요하므로 확인해야 합니다.
`Class` 생성자 그 자체는 확인할 수 없지만, 오직 프르토타입 체인과`Class.prototype`은 매우 중요하므로 확인해야 합니다.

문장 끝에 공백이 들어가 있습니다.

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`프로퍼티가 객체가 생성된 후에 변화되는지, 흥미로운 결과를 이끌어 낼수 있습니다.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Suggested change
언제`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`을 사용하여 추출할 수 있습니다. 그리고 그 결과는 그 값에 의존합니다.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Suggested change
[이곳](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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Suggested change
```js run
```js run


```js run
```js run:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Suggested change
```js run:
```js run


## Summary
##요약
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Suggested change
##요약
##요약


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"를 가지고 있고 심지어 커스텀도 가능합니다.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Suggested change
끝으로 우리가 원시적인 데이터 타입으로 동작할 뿐 아니라, 내장된오브젝트를 위한 "typeof on steroids"를 가지고 있고 심지어 커스텀도 가능합니다.
끝으로 우리가 원시적인 데이터 타입으로 동작할 뿐 아니라, 내장된객체를 위한 "typeof on steroids"를 가지고 있고 심지어 커스텀도 가능합니다.
  • ”typeof on steroids” 번역 누락
  • object객체로 번역합니다. 용어집 확인해주세요.
  • 번역 시우리라는 표현은 사용하지 않는 것으로 알고있습니다.

Copy link
ContributorAuthor

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
Copy link
Contributor

JuYeong0413 commentedOct 27, 2019
edited
Loading

  • Files changed에서 확인해보면 과제 글이 삭제되었다고 나오는데 확인 부탁드립니다.(instanceof 본문만 있어야 합니다.)
  • 커밋을 하나로 합쳐주시고, 커밋메세지 컨벤션을 따라주세요.
  • Pull Request 체크리스트 확인해주시고, 검토하신 사항은 TODO에 체크 부탁드립니다.
  • 계속 PR을 생성하고 계신데, 이력 추적을 위해 한 PR에서 작업해주세요.참고

@Malgus1995
Copy link
ContributorAuthor

Malgus1995 commentedOct 27, 2019
edited
Loading

파일 삭제는 제가 다른분꺼까지 실수로 번역해서 다급하게 지워서 과거로 돌려서 복구했습니다..

@Malgus1995Malgus1995force-pushed themaster branch 2 times, most recently fromd20ae00 to51c3e7aCompareOctober 27, 2019 16:19

Such 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.
확인하는 기능은 많은 경우에서 필수적인데, 여기에 매개변수의 타입에 의해 처리하는 법이 달라지는 다형적인 함수를 빌드하기 위해 사용할 것입니다.
Copy link
Member

@Violet-Bora-LeeViolet-Bora-LeeOct 28, 2019
edited
Loading

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

마크다운 사용법을 확인부탁드립니다.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

피드백 감사합니다. 몇개 지운것들 다시 추가했습니다.

@javascript-translate-bot

Please make the requested changes. After it, add a comment "/done".
Then I'll ask for a new review 👻

Copy link
Member

@Violet-Bora-LeeViolet-Bora-Lee left a 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

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`은 매우 중요하므로 확인해야 합니다.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

리뷰사항 반영해주세요.

@javascript-translate-bot

Please make the requested changes. After it, add a comment "/done".
Then I'll ask for a new review 👻

@Malgus1995Malgus1995force-pushed themaster branch 3 times, most recently from94fede9 to5afd4ddCompareOctober 28, 2019 13:05
@Violet-Bora-Lee
Copy link
Member

충돌발생한거 해결해주세요.
지금 master브랜치에서 최신 소스 업데이트 없이 계속 작업하고 계신것 같은데,
최신 소스랑 싱크 맞추셔야합니다.

@Malgus1995Malgus1995force-pushed themaster branch 2 times, most recently from7a7c6a3 to2748bd7CompareOctober 28, 2019 13:21
@Violet-Bora-Lee
Copy link
Member

커밋 메시지 수정 부탁드립니다.
체크리스트 예시 확인해주세요.

@Malgus1995Malgus1995force-pushed themaster branch 2 times, most recently from293c5a2 to029337eCompareOctober 28, 2019 15:07
@Malgus1995
Copy link
ContributorAuthor

완료했습니다.

@Violet-Bora-Lee
Copy link
Member

감사합니다. 머지 진행하겠습니다 👍 👍 👍

@Violet-Bora-LeeViolet-Bora-Lee merged commit13e3ce1 intojavascript-tutorial:masterOct 30, 2019
@Malgus1995
Copy link
ContributorAuthor

감사합니다. 머지 진행하겠습니다 👍 👍 👍

감사합니다!! 개인플젝은 많이했는데 ㅠㅠ 이렇게 오픈소스 기여해보고 해보고 싶었던지라 이런 협업이 처음이었던지라 많이 고생시켜드려서 죄송합니다 ㅠㅠ 하필 지금 시험기간 겹쳐서 ㅠㅠ 제가 신경 쓴다곤했는데 ㅠㅠ 조금 번거롭게 작업해드린점 죄송하게 생각하고 있습니다 ㅠㅠ 그래도 덕분에 이번기회로 많은 것을 배웠고, 다음에 작업할 땐, 꼭 도움이 되겠습니다:D 감사합니다~~

Violet-Bora-Lee added a commit that referenced this pull requestOct 30, 2019
-#342 리뷰- 맞춤법검사 안함- 일부 문장 번역 안됨
Violet-Bora-Lee added a commit that referenced this pull requestOct 30, 2019
- Object.prototype.toString 부분 보완 필요함-#342
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@JuYeong0413JuYeong0413JuYeong0413 left review comments

@Violet-Bora-LeeViolet-Bora-LeeViolet-Bora-Lee requested changes

Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

4 participants
@Malgus1995@JuYeong0413@javascript-translate-bot@Violet-Bora-Lee

[8]ページ先頭

©2009-2025 Movatter.jp