JS CookBook 6-4

Benchmark created on


Setup

var charSet = ['**', 'bb', 'cb', '**', 'cc', '**', 'dd', '**'];

function rpl(el) {
	return el !== '**';
}

Test runner

Ready to run.

Testing in
TestOps/sec
1
var newArray = charSet.filter(function(el) {
	return (el !== '**')
})
ready
2
var newArray = charSet.filter(rpl);
ready

Revisions

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