Content
@
0 reply
0 recast
2 reactions
vlatoshi.eth
@vlatoshi
.filter(Boolean) is such an easy way to remove all empty items from an array no more cannot read property of null/undefined no more null checks it passes each item to the Boolean constructor, which coerces it to true or false. if the item is truthy, it keeps it. that simple! btw filter(Boolean) is just the point-free version of filter(item => Boolean(item)). use whichever you find more readable
0 reply
0 recast
0 reaction