Is there some elegant way of filtering out falsey properties from this object with lodash/underscore? Similar to how _.compact(array) removes falsey elements fr
_.compact(array)
Another approach
const objFilter = (obj, condition) => { let newObj = {} for (const [key, value] of Object.entries(obj)) { if (condition(value)) { newObj = { ...newObj, [key]: value } } } return newObj }
Fire like this:
const newData = objFilter(oldData, (value) => value.marked === false)