What are the downsides to doing:
var myArray = []; myArray[myArray.length] = val1; myArray[myArray.length] = val2;
instead of:
I've generally thought length assignment was faster. Just found Index vs. push performance which backs that up; for my Chrome 14 browser anyway, over a single test run. However there is not much in it in Chrome.