How can JavaScript arrays have non-numeric keys?
问题 What I have learned is an array is a type of object. Objects are a collection of properties with key/value pairs. I always thought arrays are a collection of items that are numerically indexed starting at 0. Just recently, I was able to add a non-numeric key to an array. let arr = ['cribriform plate','mastoid','hyoid']; arr.eyes = 'brown'; arr.skin = 'white'; That resulted in ['cribriform plate','mastoid','hyoid',eyes : 'brown', skin : 'white']; The for...in loop of arr yielded: for(let i in