Compare adding elements to the end vs beginning of an array.
const generateData = () => [];
Initializing...
const arr = generateData(); for(let i=0; i<1000; i++) arr.push(i);
const arr = generateData(); for(let i=0; i<1000; i++) arr.unshift(i);
You can edit these tests or add more tests to this page by appending /edit to the URL.