Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

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;
});

Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #convert #object #object #array #typescript
ADD COMMENT
Topic
Name
5+9 =