lodash remove all empty values from object code example
Example 1: lodash remove null from object
_.omitBy({ a: null, b: 1, c: undefined, d: false }, _.isNil)
Example 2: remove empty object from array lodash
var myArrayFiltered = myArray.filter((ele) => {
return ele.constructor === Object && Object.keys(ele).length > 0
});