mirror of
https://github.com/hanzoai/babel.git
synced 2026-09-24 16:56:45 +00:00
23 lines
410 B
JavaScript
23 lines
410 B
JavaScript
class Cl {
|
|
#privateField = "top secret string";
|
|
|
|
constructor() {
|
|
this.publicField = "not secret string";
|
|
}
|
|
|
|
get #privateFieldValue() {
|
|
return this.#privateField;
|
|
}
|
|
|
|
set #privateFieldValue(newValue) {
|
|
this.#privateField = newValue;
|
|
}
|
|
|
|
publicGetPrivateField() {
|
|
return this.#privateFieldValue;
|
|
}
|
|
|
|
publicSetPrivateField(newValue) {
|
|
this.#privateFieldValue = newValue;
|
|
}
|
|
} |