Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
class A {
  constructor(x, a) {
    #x = x; =;
  foo() {
    console.log(this?.#x); // optional chaining
    // Possible to use optional chaining?
    // And this.#x and #x refer to same thing?

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