![]() |
VOOZH | about |
Lodash _.omit() method is used to return a copy of the object that is composed of the own and inherited enumerable property paths of the given object that are not omitted. It is the opposite of the _.pick() method.
Note: The _.omit() method is slower than the _.pick() method.
_.omit(object, [paths])This method returns the new object.
Example 1: In this example, we have omitted the 'name' and 'username' by using the _.omit() method by passing the path.
Output:
{password: "gfg@1234"}Example 2: In this example, we have omitted the 'x' and 'y' by using the _.omit() method by passing the path.
Output:
{'z': 3}