Open1
配列がobjectであり、propertyで値を管理しているなら、array[100]にのみ値を代入した場合になぜ、array.lengthは101になるのか?1ではないのか?
empty item ??
node
Welcome to Node.js v14.17.2.
Type ".help" for more information.
> a=[]
[]
> a[100]=100
100
> a
[ <100 empty items>, 100 ]
> a.hasOwnProperty(100)
true
> a.hasOwnProperty(0)
false
ecmaでは仕様だけが策定されている。定義はエンジン次第と思われる。