Equality test in array filter (v2)

Revision 2 of this benchmark created on


Setup

const arr = '/test/string//with/slash//for/empty///1'.split('/')

Test runner

Ready to run.

Testing in
TestOps/sec
Boolean
arr.filter(Boolean)
ready
v !== ''
arr.filter(v => v !== '')
ready
v => v
arr.filter(v => v)
ready
with function
function is_truthy(v) {
	return v;
}


arr.filter(is_truthy)
ready
!!v
arr.filter(v => !!v)
ready

Revisions

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