Are JavaScript arrays actually linked lists?

前端 未结 6 739
眼角桃花
眼角桃花 2020-12-15 04:47

I\'m new to Javascript, and notice that you don\'t need to specify an array\'s size and often see people dynamically creating arrays one element at time. This would be a hug

6条回答
  •  -上瘾入骨i
    2020-12-15 05:15

    It most likely depends on what JavaScript engine you use.

    Internet Explorer uses a mix of sparse arrays and dense arrays to make that work. Some of the more gory details are explained here: http://blogs.msdn.com/b/jscript/archive/2008/04/08/performance-optimization-of-arrays-part-ii.aspx.

提交回复
热议问题