Skip to content

Instantly share code, notes, and snippets.

@wkronemeijer
Last active June 18, 2016 17:52
Show Gist options
  • Save wkronemeijer/ff15ea98bca28c5e3d12 to your computer and use it in GitHub Desktop.
Save wkronemeijer/ff15ea98bca28c5e3d12 to your computer and use it in GitHub Desktop.
A convenience function when you have a list of records and need only a member; index $1 with the property of choice and map it over the collection to obtain a list of members.
const $1 = new Proxy({}, {
get(target, key) {
return x => x[key];
}
});
@wkronemeijer
Copy link
Author

Example:

"Colorless green ideas sleep furiously".split(" ").map($1.length)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment