JQuery.grep vs Javascript Filter (v2)

Revision 2 of this benchmark created on


Preparation HTML

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>

Setup

var array = []
    for(var i = 0; i < 100000; i++){
      array.push(i);
    }
    
    var filter = function(item){
      return item %3;
    }

Test runner

Ready to run.

Testing in
TestOps/sec
Jquery Grep
result = $.grep(array,filter)
ready
Filter
result = array.filter(filter)
ready

Revisions

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