$.map vs Array.map (v2)

Revision 2 of this benchmark created on


Preparation HTML

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

Setup

var arr = [],
        i = 0, v,
        ilen = 10000,
        callback = function(v) {
        return parseInt(v);
        }
        
        
        
    for (; i < ilen; i++) {
      arr[i] = Math.random() * 1000;
    }

Test runner

Ready to run.

Testing in
TestOps/sec
$.map
v = $.map(arr, callback);
ready
Array.map
v = arr.map(callback);
ready

Revisions

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