Boolean filter

Benchmark created on


Preparation HTML

<script>
let array = [0, 1, false, 2, '', 3, null, 'a', undefined, NaN, 'b'];
</script>

Test runner

Ready to run.

Testing in WebKit 537.36 / undefined
TestOps/sec
Boolean upcast
array.filter(Boolean);
ready
Double false operator
array.filter((a) => (!!a))
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.