{0: { name: 'Петя', age: 15 }, 1: { name: 'Вася', age: 21}}
[{ name: 'Петя', age: 15 }, { name: 'Вася', age: 21}]
function normalizeObject(obj) {
if (Object.keys(obj).every(key => Number(key).toString() === key)) {
return Object.assign([], obj);
}
return obj;
}