Created
June 26, 2020 13:53
-
-
Save zeptobook/10477d32aa9c2c33adf62da15cd6a180 to your computer and use it in GitHub Desktop.
This file contains 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 Message { | |
#message = "ZeptoBook" | |
greet() { console.log(this.#message) } | |
} | |
const greeting = new Message() | |
greeting.greet() // ZeptoBook | |
console.log(greeting.#message) // Private name #message is not defined |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment