- Lodash Tutorial
- Lodash - Home
- Lodash - Overview
- Lodash - Environment Setup
- Lodash - Array
- Lodash - Collection
- Lodash - Date
- Lodash - Function
- Lodash - Lang
- Lodash - Math
- Lodash - Number
- Lodash - Object
- Lodash - Seq
- Lodash - String
- Lodash - Util
- Lodash - Properties
- Lodash - Methods
- Lodash Useful Resources
- Lodash - Quick Guide
- Lodash - Useful Resources
- Lodash - Discussion
Lodash - omit method
Syntax
_.omit(object, [paths])
The opposite of _.pick; this method creates an object composed of the own and inherited enumerable property paths of object that are not omitted.
Arguments
object (Object) − The source object.
[paths] (...(string|string[])) − The property paths to omit.
Output
(Object) − Returns the new object.
Example
var _ = require('lodash'); var object = { 'a': 1, 'b': '2', 'c': 3 }; var result = _.omit(object, ['a', 'b']); console.log(result);
Save the above program in tester.js. Run the following command to execute this program.
Command
\>node tester.js
Output
{ c: 3 }
lodash_object.htm
Advertisements