Created
February 24, 2016 00:45
-
-
Save rndme/a3a3dfea0847a5710d25 to your computer and use it in GitHub Desktop.
This file contains 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
// uses arrow functions to define methods and creates an un-breakable bind to `this` | |
var x=new function(){ | |
Object.assign(this, { | |
val : 530, | |
get: ( )=> this.val, | |
set: (v)=> this.val=v, | |
}); | |
}; | |
x.get(); // 530 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment