Skip to content

Instantly share code, notes, and snippets.

@softwarespot
Created September 7, 2015 04:30
Show Gist options
  • Save softwarespot/7b64b09a4df97da463b8 to your computer and use it in GitHub Desktop.
Save softwarespot/7b64b09a4df97da463b8 to your computer and use it in GitHub Desktop.
ES2015 class
// 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