Which is the best way to "convert" associative array to standard (0 based indexes) array. Is there any other way than iteration and rewriting each item?
I have an array which was created by counting appearances of some properties and it is needed that way. The output array lookes like:
let ASSARR = {
"abc": { "c": 5, "p": 3 },
"def": { "c": 1, "p": 10 },
"ghi": { "c": 15, "p": 7 }
};
...and so.
I need to filter and sort it though then I need to "convert" it to standard array so it looked more like this:
let STARR = [
{ "i": "abc", "c": 5, "p": 3 },
{ "i": "def", "c": 1, "p": 10 },
{ "i": "ghi", "c": 15, "p": 7 }
];
Do I need to iterate by for or similar loop or maybe there is more effective way to do this?