Created
March 11, 2016 15:21
-
-
Save 4e1e0603/806446eb28d94fa17234 to your computer and use it in GitHub Desktop.
ES6 Singletons: Approach 1
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 Person { | |
constructor() { | |
this.greeting = 'hello'; | |
} | |
talk() { | |
alert(this.greeting); | |
} | |
} | |
let _person = new Person(); | |
export default _person; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment