deno/cli/tests/es_private_fields.js
2020-05-30 17:32:48 +02:00

15 lines
202 B
JavaScript

class Foo {
#field = "field";
setValue(val) {
this.#field = val;
}
getValue() {
return this.#field;
}
}
const bar = new Foo();
bar.setValue("PRIVATE");
console.log(bar.getValue());