Created
September 7, 2015 04:30
-
-
Save softwarespot/7b64b09a4df97da463b8 to your computer and use it in GitHub Desktop.
ES2015 class
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
// Example of an ES2015 class | |
class Example { | |
constructor() { | |
this.property1 = 1; | |
this.property2 = 2; | |
} | |
someMethod() { | |
this.propery1 = this.propery2; | |
} | |
} | |
function main() { | |
let example = new Example(); | |
console.log(example.someMethod()); | |
} | |
main(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment