R
Reactiflux

Adi – 14-45 Feb 7

Adi – 14-45 Feb 7

AAdi2/7/2022
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?
UUUnknown User2/7/2022
2 Messages Not Public
Sign In & Join Server To View
AAdi2/7/2022
but I want to filter out both i.e true property items and undefined property items and use them for calculations ahead
UUUnknown User2/7/2022
Message Not Public
Sign In & Join Server To View
AAdi2/7/2022
no I am saying I want to separate items with true property and separate items with undefined property and do calculations on it separately
const result = items.filter(item => !item.someProperty)
const result = items.filter(item => !item.someProperty)
this does not work
UUUnknown User2/8/2022
4 Messages Not Public
Sign In & Join Server To View

Looking for more? Join the community!

R
Reactiflux

Adi – 14-45 Feb 7

Join Server
Want results from more Discord servers?
Add your server
Recommended Posts