javascript-tutorial / javascript-tutorial/ko.javascript.info

[오번역수정] 클래스 필드에 대해서

Open
#966 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
HTML
Stars
2k
Forks
852
PR merge metrics
No merged PRs in 30d

Description

오번역

9-1 클래스와 기본문법
"클래스 필드는 생성자가 그 역할을 다 한 이후에 처리됩니다." 라는 설명이 조금 이상한 것 같고, 원문에는 해당 내용이 나와있지 않습니다.

번역

아예 해당 내용을 지우는 게 올바를 것 같습니다.

이슈

제가 직접 코드를 쳐서 돌려본 결과 클래스 필드는 생성자 이후에 처리되는 게 아니라, 생성자 이전에 처리되는 것을 확인했습니다.
nodeJS v15.3.0 에서 돌린 코드입니다.

class Person {
 age = console.log('in Person class field');

 constructor(name) {
  this.name = name;
  console.log('in Person constructor');
 }
}

class User extends Person {
 address = console.log('in User class field')

 constructor(name) {
  super(name);
  console.log('in User constructor')
 }
}

const user = new User('john');

/* 콘솔 출력 결과
 * in Person class field
 * in Person constructor
 * in User class field
 * in User constructor
 */

Pull Request(PR)를 통해 수정할 의향이 있습니까?

필요하시다면 PR 날리겠습니다.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked “Classes and basic syntax” section at #ref-19 and consult README.md for the translation rules; the issue also links the translation best-practices Wiki. Compare the Korean wording with the reported JavaScript class-field order, then update the translation so the inaccurate explanation is removed or corrected.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
documentation
Issue type
Documentation
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.