array delete vs splice (v2)

Revision 2 of this benchmark created by Jasper on


Setup

var arr = [1,2,3,4,5,6,7,8,9,0];
    var item = 5;

Test runner

Ready to run.

Testing in
TestOps/sec
splice
arr.splice(arr.indexOf(item), 1);
ready
delete
delete arr[arr.indexOf(item)];
ready

Revisions

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