.filter(value => value)

Benchmark created on


Setup

var arr = [{}, {}, null, undefined, {}, {}, 'A', 1111]

Test runner

Ready to run.

Testing in
TestOps/sec
.filter(value => value)
var result = arr.filter(value => value)
ready
.filter(Boolean)
var result = arr.filter(Boolean)
ready
.filter(value => Boolean(value))
var result = arr.filter(value => Boolean(value))
ready

Revisions

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