I have to remove unwanted object properties that do not match my model. How can I achieve it with Lodash?
My model is:
var model = { fname: null, lna
Here I have used omit() for the respective 'key' which you want to remove... by using the Lodash library:
var credentials = [{ fname: "xyz", lname: "abc", age: 23 }] let result = _.map(credentials, object => { return _.omit(object, ['fname', 'lname']) }) console.log('result', result)