lodash remove properties with empty values 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
});