3 ms·
Actually an object in JS stores string keys only, if you try to insert something else it's auto-converted to strings. Array is an object wich stores integer key
by Skinney 13y ago
Actually an object in JS stores string keys only, if you try to insert something else it's auto-converted to strings. Array is an object wich stores integer keys. You don't really have a datastructure that stores arbitrary keys in JS (when not including third party libraries). This will be changed with Ecmascript Harmony though (dedicated Map type)