Last active
March 14, 2019 13:51
-
-
Save jennmueng/ef1f4a0667036b9ea578665c55fd787f to your computer and use it in GitHub Desktop.
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
const instanceFactory = (x) => { | |
this.a = 10; | |
this.b = x * 5; | |
this.c = () => { | |
return a + b; | |
} | |
} | |
const instance = new instanceFactory(3); | |
// basically returns an object with the following values appended to this. | |
instance.a; // 10 | |
instance.b; // 15 | |
instance.c() // 25 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment