Created
May 23, 2019 21:37
-
-
Save pdbradley/ded11849a3f3b53f408a1e63c4b0e733 to your computer and use it in GitHub Desktop.
help us dave
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 dontGetIt { | |
| constructor() { | |
| this.foo = 'hello'; | |
| } | |
| hello() { | |
| this.foo; | |
| } | |
| } | |
| dgi = new dontGetIt; | |
| dgi.hello(); | |
| // why does line 12 return undefined and not 'hello' |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
how can I set values in the constructor that I can access in any of the included functions in the class? similar to instance variables in a ruby class