Skip to content

Instantly share code, notes, and snippets.

@boopathi
Last active July 29, 2017 09:58
Show Gist options
  • Select an option

  • Save boopathi/721228f8c136029bb1142aee29a20199 to your computer and use it in GitHub Desktop.

Select an option

Save boopathi/721228f8c136029bb1142aee29a20199 to your computer and use it in GitHub Desktop.
class A {
  #x;
  constructor(x) {
    #x = x;
    this.foo = this.foo.bind(new A(10));
  }
  foo() {
    console.log(#x, this.#x); // ?
  }
}

const a = new A(20);
a.foo(); // ?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment