++ vs +=

Benchmark created by plusplus vs plusequals on


Description

++ vs += inside a for loop

Setup

var arr = [1, 2, 3, 4, 5],
        max = arr.length;

Test runner

Ready to run.

Testing in
TestOps/sec
++
for(var i = 0; i < max; i++) {
    console.log(i);
}
ready
+=
for(var i = 0; i < max; i+=1) {
    console.log(i);
}
ready

Revisions

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

  • Revision 1: published by plusplus vs plusequals on