Created
September 27, 2018 13:53
-
-
Save vlastachu/27ec7fc5426ac28e3b0568618d02399a 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
var _ = new Proxy({}, {get: (object, prop) => x => Reflect.get(x, prop)}) | |
// Now you can use `_.method` instead of `x => x.method` | |
var a = {someMethod: x => x + 1} | |
_.someMethod(a)(1) // => 2 | |
a.prototype.prototypeMethod = (a, b) => a + b | |
_.prototypeMethod(a)(1, 2) // => 3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment