Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Spread operator vs Array.prototype.apply vs Array.prototype.concat
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/122.0.0.0 Safari/537.36 Edg/122.0.0.0
Browser:
Chrome 122
Operating system:
Windows
Device Platform:
Desktop
Date tested:
2 years ago
Test name
Executions per second
Spread operator
7659222.5 Ops/sec
Array.push.apply
16704902.0 Ops/sec
concat
3873145.2 Ops/sec
HTML Preparation code:
<div>Demo</div>
Script Preparation code:
console.log('js prep');
Tests:
Spread operator
var a = [1, 2,5 ,3, 44, 6, 7, 8, ,9, 10, 11, 12, 13]; var b = [14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24]; var c = [...a, ...b];
Array.push.apply
var a = [1, 2,5 ,3, 44, 6, 7, 8, ,9, 10, 11, 12, 13]; var b = [14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24]; var c = a.push.apply(a, b)
concat
var a = [1, 2,5 ,3, 44, 6, 7, 8, ,9, 10, 11, 12, 13]; var b = [14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24]; var c = a.concat(b);