Skip to content

Instantly share code, notes, and snippets.

@YonatanKra
Created September 21, 2021 07:55
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
class MyClass {
#somethingCool = 5;
get somethingCool() {
return this.#somethingCool;
}
set somethingCool(value) {
this.#somethingCool = value;
}
}
const x = new MyClass();
JSON.stringify(x); // '{}'
x.somethingCool = 10;
JSON.stringify(x); // '{}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment