I am looking for a method to 'Normalize' array indexes in Javascript.
I have a large array ( _spm ) containing values with numeric indexes like ( _spm[201023] ).
( For You, to understand: Re-indexing the array starting from zero. )
I would need a method to make all the records have a more human-friendly index ( and may also be sorted ).
I mean:
function normalize( arrayWithMessedUpIndexes ){ return reIndexedAndOrderedArray }
A possible input is the array _spm considering that:
_spm[201023] = "s";
_spm[376615] = "m";
A possible output of the method I am looking for ( using the input array above ):
_spm[0] = "s"
_spm[1] = "m"