How are javascript arrays implemented?

后端 未结 9 808
天命终不由人
天命终不由人 2020-12-05 17:09

Namely, how does the following code:

var sup = new Array(5);
sup[0] = \'z3ero\';
sup[1] = \'o3ne\';
sup[4] = \'f3our\';
document.write(sup.length + \"
9条回答
  •  误落风尘
    2020-12-05 18:00

    If you're intending to implement objects with array-like access, the Array Mozilla dev center article is a great resource. Unfortunately I don't know the in depth details of Array implementation but there are a lot of details in that article.

提交回复
热议问题