Last active
August 18, 2017 11:37
-
-
Save marekpiechut/52a4039377e1ecf0ec5c6200b177e786 to your computer and use it in GitHub Desktop.
Benchmark - object closure
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 createMyType = (startVal) => { | |
| let val = startVal | |
| let magic = ... | |
| return { | |
| add: (b) => { | |
| val += magic + b | |
| }, | |
| sub: (b) => { ... }, | |
| mul: (b) => { ... }, | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment