2👍
✅
You don’t really need lodash for this.
Use a vanilla JS filter method like this
return this.data.filter((el) => !el.deleted.status)
or this if you want to check for strict equality to false
, rather than just using a falsy value (undefined
, null
, etc…)
return this.data.filter((el) => el.deleted.status === false)
2👍
While using lodash is not necessary, to answer your question
return _.filter(fields, 'deleted.status', false)
or
return _.filter(fields, {deleted: {status: false}})
Source:stackexchange.com