August 30, 2017

Spread operator doubles runtime

the following two expressions do the same job, but the later one doubles the runtime.

const arr = new Array(100);
arr[0] = 1;
const arr = [1, ...new Array(99)];