Skip to content
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

这里是不是少了个 this? #1125

Closed
shane-peterson opened this issue Jul 8, 2022 · 0 comments
Closed

这里是不是少了个 this? #1125

shane-peterson opened this issue Jul 8, 2022 · 0 comments

Comments

@shane-peterson
Copy link

class Counter {
  #xValue = 0;

  constructor() {
    super();
    // ...
  }

  get #x() { return #xValue; }
  set #x(value) {
    this.#xValue = value;
  }
}

引用自第22 章,私有属性写法的第 6 个代码块
CodePen
各位工友们大家好,上面代码中,#x 中的 return 是不是少一个 this?

@shane-peterson shane-peterson changed the title 关于私有属性,我有话要说 这里是不是少了个 this? Jul 9, 2022
ruanyf added a commit that referenced this issue Jul 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant