Answers for "cast array to object typescript"

5

convert object object to array typescript

const persons = { 
    john: { age: 23, year:2010},
    jack: { age: 22, year:2011},
    jenny: { age: 21, year:2012}
}
const resultArray = Object.keys(persons).map(index => {
    let person = persons[index];
    return person;
});
Posted by: Guest on November-30-2020

Code answers related to "cast array to object typescript"

Code answers related to "TypeScript"

Browse Popular Code Answers by Language