javascript - Using the push method or .length when adding to array? -
what downsides doing:
var myarray = []; myarray[myarray.length] = val1; myarray[myarray.length] = val2;
instead of:
var myarray = []; myarray.push(val1); myarray.push(val2);
i'm sure push method more "acceptable", there differences in functionality?
push way faster, 300% faster.
Comments
Post a Comment