Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
Create Array Filled with Undefined
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.0.0 Safari/537.36
Browser:
Chrome 102
Operating system:
Windows
Device Platform:
Desktop
Date tested:
2 years ago
Test name
Executions per second
Array.apply
3652.1 Ops/sec
Array.concat
3052.9 Ops/sec
Array.fill
36809.0 Ops/sec
Custom function
3946.3 Ops/sec
Script Preparation code:
var length = 10000;
Tests:
Array.apply
const array = Array.apply(null, { length });
Array.concat
const array = [].concat.apply([], { length });
Array.fill
const array = []; array.length = length; array.fill(undefined);
Custom function
const func = (...args) => args; func.apply(null, { length });