Email or username:

Password:

Forgot your password?
2 comments
hazel

@rini @lily yep, its just showing all key value pairs of the array and hiding the numbered keys. and those keys are actually strings btw not numbers, kinda

demonstration that changing the 0th item of an array not with the number 0 as the key but with the *string* "0" works
rini ☁️

@h @lily yeah the indices are all treated as strings (but optimised internally). by the spec arrays are "exotic objects", which means their impl can do weird things (length being set automatically when indices are added)

also fun fact most array methods dont actually require an array, so you can do [].join.call({ 0: "a", 1: "b", length : 2 }, ", ")

Go Up