Created
June 11, 2015 17:23
-
-
Save panuhorsmalahti/cf099037c4428ef6c28b to your computer and use it in GitHub Desktop.
ES6 proxy property getter shorthand
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
const _ = new Proxy({}, { get: (target, prop) => it => it[prop] }); | |
// Evaluates to [{ foo: true }] | |
[{ foo: true }, { foo: false }].filter(_.foo); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment