_.pickTypes

Returns one or more new objects with keys that only contain values ​​of defined types

_.pickTypes(types, objects)

Parameters:

  • types [string or array of strings]: the types to be pick

  • objects [object or array of objects]: the objects that will have their values picked

Example:

_.pickTypes('number', {name: 'drezzy', age: 17, birthday: 11})
// => { age: 17, birthday: 11}  

Last updated