omit source npm

_.omit(object, [props])

The opposite of _.pick; this method creates an object composed of the own and inherited enumerable properties of object that are not omitted.

Arguments

  1. object (Object)

    The source object.

  2. [props] (...(string|string[])

    The property names to omit, specified individually or in arrays..

Returns (Object)

Returns the new object.

Example

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

_.omit(object, 'user');
// => { 'age': 40 }