I ran the following jsperf https://jsperf.com/push-vs-define-anaoum
and found out that push in this case :
var a = [];
a.push([1,2,3]);
a.push(["a","b","c"]);
is faster than just declaring a with the subarrays inside :
var a = [
[1,2,3],
["a","b","c"]
];
Could anyone please tell me why or point me in the right documentation?


pushcame out 20% slower..push()Firefox 55 on Windows 10 came out 23% slower but Chrome 61 came out 75% faster (similar results).