T.J. Crowder (2017-03-17T12:46:57.000Z)
tj.crowder at farsightsoftware.com (2017-03-17T13:00:04.544Z)
Important to remember that every change to syntax rattles a *bunch* of parsing cages. BTW, "pick" is exactly what Underscore calls this function: http://underscorejs.org/#pick > `_.pick(object, *keys) ` > > Return a copy of the object, filtered to only have values for the > whitelisted keys (or array of valid keys). Alternatively accepts > a predicate indicating which keys to pick. > > ```js > _.pick({name: 'moe', age: 50, userid: 'moe1'}, 'name', 'age'); > ``` > => `{name: 'moe', age: 50}` > > ```js > _.pick({name: 'moe', age: 50, userid: 'moe1'}, function(value, key, object) { > return _.isNumber(value); > }); > ``` > => `{age: 50}` I'd be more enthusiastic about `Object.pick` or similar, accepting an iterable of whitelisted keys or a predicate function. -- T.J. Crowder