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?6 Replies
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
but I want to filter out both i.e true property items and undefined property items
and use them for calculations ahead
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
no I am saying I want to separate items with true property and separate items with undefined property and do calculations on it separately
this does not work
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
This thread hasn’t had any activity in 12 hours, so it’s now locked.
Threads are closed automatically after 12 hours. If you have a followup question, you may want to reply to this thread so other members know they're related. https://discord.com/channels/102860784329052160/565213527673929729/940257028042006628