code fight club

Benchmark created by James Billingham on


Test runner

Ready to run.

Testing in
TestOps/sec
left
var arr = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];

for (var i=0,len=arr.length; i<len; ++i) {
    var value = arr[i];
    if (value > 5) {
        break;
    }
    console.log(value);
}
 
ready
right
var arr = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];

arr.some(function(value) {
    if (value > 5) {
        return true;
    }
    console.log(value);
});
 
ready

Revisions

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

  • Revision 1: published by James Billingham on