Skip to content

Instantly share code, notes, and snippets.

@panuhorsmalahti
Created June 11, 2015 17:23
Show Gist options
  • Save panuhorsmalahti/cf099037c4428ef6c28b to your computer and use it in GitHub Desktop.
Save panuhorsmalahti/cf099037c4428ef6c28b to your computer and use it in GitHub Desktop.
ES6 proxy property getter shorthand
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