string repeat vs array join

Benchmark created on


Test runner

Ready to run.

Testing in
TestOps/sec
string repeat
return '../'.repeat(100).slice(0, -1);
ready
array join
return new Array(100).fill('..').join('/');
ready
string repeat 2
return '/..'.repeat(100).slice(1);
ready

Revisions

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