wdr-joinalternate

Benchmark created on


Test runner

Ready to run.

Testing in
TestOps/sec
Alex
var z = ['hi', 'please', 'help', 'me'],
    l = z.length,
    y = '';
for (var i = 0; i < l; i += 2)
y += 'X' + z[i] + 'Y' + z[i + 1];
ready
Kyek
var z = ['hi', 'please', 'help', 'me'],
    l = z.length,
    y = '';
for (var i = 0; i < l; i++)
y += (i % 2 ? 'X' : 'Y') + z[i];
ready
Souless
var z = ['hi', 'please', 'help', 'me'],
    l = z.length,
    y = '';
for (var i = 0; i < l; i += 2)
y += 'X' + z[i] + ((i > 1) ? 'Y' + z[i + 1] : '');
ready

Revisions

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