Using the push method or .length when adding to array?

后端 未结 6 1787
慢半拍i
慢半拍i 2020-12-31 08:26

What are the downsides to doing:

var myArray = [];
myArray[myArray.length] = val1;
myArray[myArray.length] = val2;

instead of:



        
6条回答
提交回复
热议问题