AdiA
Reactiflux5y ago
10 replies
Adi

Adi – 14-45 Feb 7

If I want to filter items based on true property then is this correct way:
const result = items.filter(item => item.someProperty === true)

and if property not present i.e undefined then
const result = items.filter(item => item.someProperty !== true)

or can this be improved?
Was this page helpful?