Array.prototype.every vs. _.every

Benchmark created by Trey Hunner on


Preparation HTML

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

Setup

var array = _.shuffle(_.range(1000));

Test runner

Ready to run.

Testing in
TestOps/sec
every
var r = array.every(function (val) {
  return val < 1000;
});
ready
_.every
var r = _.every(array, function (val) {
  return val < 1000;
});
ready

Revisions

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

  • Revision 1: published by Trey Hunner on
  • Revision 2: published by Tony Quetano on