omitBy source npm

_.omitBy(object, [predicate=_.identity])

The opposite of _.pickBy; this method creates an object composed of the own and inherited enumerable properties of object that predicate doesn't return truthy for.

Arguments

  1. object (Object)

    The source object.

  2. [predicate=_.identity] (Function|Object|string)

    The function invoked per property.

Returns (Object)

Returns the new object.

Example

var object = { 'user': 'fred', 'age': 40 };

_.omitBy(object, _.isNumber);
// => { 'user': 'fred' }