Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
filter(Boolean) vs. filter(a => a)
Removing empties
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36
Browser:
Chrome 137
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
11 months ago
Test name
Executions per second
filter(Boolean)
1334.6 Ops/sec
filter(a => a)
1326.4 Ops/sec
filter(a => !!a)
967.3 Ops/sec
Script Preparation code:
window.list = []; for (let i = 0; i < 65536; i++) { window.list.push(Math.random() > 0.5 ? 1 : 0); }
Tests:
filter(Boolean)
list.filter(Boolean);
filter(a => a)
list.filter(a => a);
filter(a => !!a)
list.filter(a => !!a)