Remove from array: Array.Filter vs Array.splice(Array.indexOf) (v2)

Revision 2 of this benchmark created on


Preparation HTML

<script>
  var a;
  var reset = function() {
   a = ["dfsgdfgdfgs", "sdfasdfasfsd", "xcvzv", "werewttyr", "fdghjtew", "oeqruity", "mx,nbvxmbnv", "98437tyreiulhjgkfd"];
  
  }
  reset();
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
Array.Filter
a = a.filter(function(i) {
 return (i !== "werewttyr");
});
reset();
ready
Array.splice(Array.indexOf)
a.splice(a.indexOf("werewttyr"), 1);
reset();
ready

Revisions

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