I am coding in javascript & I need HashMap type structure . Normally when I need hashmaps , I would use associative arrays only (with strings as keys). But this time I need integers as keys to hashmaps.
So if I try to store A[1000]=obj, 1001 sized array is created & A[1001] is put as obj. Even if I try A["1000"]=obj , it still allocates 1001 spaces & fills them with undefined.
I dont want that as my keys could be very large ( around 1 mill). I could use it as A["dummy1000"]=obj but I dont want to use this dirty method.
Anyway of doing it elegantly & with ease too ?