Backboneloopvsfor

Benchmark created on


Preparation HTML

<script src="//underscorejs.org/underscore-min.js">
</script>
<script>
  var a = _.range(100);
  var b;
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
Underscore Reduce
a.reduce(function(memo, item) {
  return memo + item;
}, "");
ready
for loop
var i = 0;
b = "";
for (; i < a.length; i += 1) {
  b += i;
}
ready

Revisions

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