Toggle navigation
MeasureThat
.net
Create a benchmark
Tools
Feedback
Feature Requests
FAQ
Register
Log In
Run results for:
Array.flat() vs. concat() + spreadOperator + concat.apply()
Compare the Array.flat() to concat() + spread operator
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:152.0) Gecko/20100101 Firefox/152.0
Browser:
Firefox 152
Operating system:
Mac OS X 10.15
Device Platform:
Desktop
Date tested:
one month ago
Benchmark engine:
Benchmark.js
Array.flat()
8.5M/s
concat.apply()
8.4M/s
concat() + spread operator
7.8M/s
View exact numbers
Test name
Executions per second
✓
Array.flat()
8,482,173 Ops/sec
concat.apply()
8,395,647 Ops/sec
concat() + spread operator
7,763,994 Ops/sec
Tests:
concat() + spread operator
var params = [[ 1, 2 ], [ "hello", true, 7 ]]; var other = [].concat(...params);
Array.flat()
var params = [[1, 2, params], [ "hello", true, 7 ]]; var other = params.flat();
concat.apply()
var params = [[ 1, 2 ], [ "hello", true, 7 ]]; var other = [].concat.apply([], params);