Matthew pfp
Matthew
@matthew
TIL you can just do .filter(Boolean) instead of .filter((prop) => !!prop)
6 replies
1 recast
41 reactions

jtgi pfp
jtgi
@jtgi
something sweet about passing functions direct to filter, even others like: users.filter(isPremium) posts.map(hydrateCast)
1 reply
0 recast
0 reaction

Matthew pfp
Matthew
@matthew
yeah that syntax is so clean! for whatever reason I just hadn't discovered Boolean() until this point I need to add custom chat gpt instructions to always generate that way
1 reply
0 recast
0 reaction