Spread vs Concat

Benchmark created on


Setup

const tag = 'div'
const classes = ['foo', 'bar'];

Test runner

Ready to run.

Testing in
TestOps/sec
spread
[tag, ...Array.from(classes).sort()].join('.');
ready
concat
[tag].concat(Array.from(classes).sort()).join('.');
ready
double spread
[tag, ...[...classes].sort()].join('.');
ready

Revisions

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