defining array in javascript

前端 未结 5 1064
忘了有多久
忘了有多久 2020-12-05 14:02

I want to create an array in javascript and remember two ways of doing it so I just want to know what the fundamental differences are and if there is a performance differenc

5条回答
  •  天涯浪人
    2020-12-05 14:31

    I think both ways are the same in terms of performance since they both create an "Array object" eventually. So once you start accessing the array the mechanism will be the same. I not too sure about how different the mechanisms to construct the arrays be (in terms of performance) though it shouldn't be any noticeable gains using one way to the other.

提交回复
热议问题