You can use Object.assign()
with an empty array literal []
as the target
:
const input = {_x000D_
"0": "1",_x000D_
"1": "2",_x000D_
"2": "3",_x000D_
"3": "4"_x000D_
}_x000D_
_x000D_
const output = Object.assign([], input)_x000D_
_x000D_
console.log(output)
_x000D_
If you check the polyfill, Object.assign(target, ...sources)
just copies all the enumerable own properties from the source
objects to a target object. If the target
is an array, it will add the numerical keys to the array literal and return that target
array object.