named or anonymous functions (v41)

Revision 41 of this benchmark created by Mike on


Preparation HTML

<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/3.10.1/lodash.min.js"></script>

Setup

var array = [];
    
    for(var i = 0; i++; i < 1000)
    {
      array.push(i);
    }

Test runner

Ready to run.

Testing in
TestOps/sec
anon function
_.forEach(array, function(n) {
  console.log(n);
});
ready
named function
function named(n) {
  console.log(n);
}

_.forEach(array, named.bind(this));
ready

Revisions

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