Created
June 8, 2017 06:55
-
-
Save sophistifunk/af96635d8dfff12a242d477f732a93a3 to your computer and use it in GitHub Desktop.
private.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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