Created
August 30, 2014 00:12
-
-
Save jamesmanning/6c2f6395cbbb1218c20f to your computer and use it in GitHub Desktop.
simple class example
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 Foo { | |
constructor(someCtorParam) { | |
this.someClassVar = someCtorParam; | |
} | |
someMethod() { | |
console.log('in some method: ' + this.someClassVar); | |
} | |
} | |
var foo = new Foo('passed-in string value'); | |
foo.someMethod(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment