HASTY
JS
performance
Filtering numbers - {Shorts}
A few neat ways of filtering for numbers using JavaScript
Globals
const data = [ ...new Array(1000).fill(0).map(() => Math.random() > 0.5) ]
Cases
0 ops/s
data.filter(x => x === true)
0 ops/s
data.filter(x => !!x)
0 ops/s
data.filter(Boolean)
Page
Shorts
Wall of Love
Embed
Share
Donate
Options
Epochs:
Timeout:
Run