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 (X11; Linux x86_64; rv:144.0) Gecko/20100101 Firefox/144.0
Browser:
Firefox 144
Operating system:
Linux
Device Platform:
Desktop
Date tested:
9 months ago
Benchmark engine:
Benchmark.js
Array.flat()
14.8M/s
concat.apply()
11.9M/s
concat() + spread operator
11.3M/s
View exact numbers
Test name
Executions per second
✓
Array.flat()
14,784,101 Ops/sec
concat.apply()
11,894,819 Ops/sec
concat() + spread operator
11,340,035 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);