lodash check for null or undefined values in array of objects code example
Example 1: Lodash remove duplicates from array
var users = [
{id:1,name:'ted'},
{id:1,name:'ted'},
{id:1,name:'bob'},
{id:3,name:'sara'}
];
var uniqueUsersByID = _.uniqBy(users,'id'); //removed if had duplicate id
var uniqueUsers = _.uniqWith(users, _.isEqual);//removed complete duplicates
Example 2: lodash remove null from object
_.omitBy({ a: null, b: 1, c: undefined, d: false }, _.isNil)