summaryrefslogtreecommitdiff
path: root/tests/specs/run/es_private_fields/es_private_fields.js
blob: b5f83e39c799130375c31cd8d8a83d7ef05e62b5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
class Foo {
  #field = "field";

  setValue(val) {
    this.#field = val;
  }

  getValue() {
    return this.#field;
  }
}

const bar = new Foo();
bar.setValue("PRIVATE");
console.log(bar.getValue());