Skip to content

Instantly share code, notes, and snippets.

@sophistifunk
Created June 8, 2017 06:55
Show Gist options
  • Save sophistifunk/af96635d8dfff12a242d477f732a93a3 to your computer and use it in GitHub Desktop.
Save sophistifunk/af96635d8dfff12a242d477f732a93a3 to your computer and use it in GitHub Desktop.
private.js
class Alpha {
constructor() {
this.a = "red";
this.#b = "green";
}
identify() {
console.log(this.a, this.#b);
}
}
class Bravo extends Alpha {
constructor() {
super();
this.a = "Ryu";
this.#b = "Dhalsim";
}
}
new Alpha().identify();
// red, green
new Bravo().identify();
// Ryu, green
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment