I need to "skinny down" and list of objects to many less attributes, but still a lot. My code looks like this:
function reduceSpeakersData(speakers: Speaker[]) {
return speakers.map(function(speaker: Speaker) {
//return speaker;
return ({
id: speaker.id,
firstName: speaker.firstName,
lastName: speaker.lastName,
imageUrl: speaker.imageUrl,
company: speaker.company
})
});
}
I know if I have:
firstName: firstName
I can make it just
firstName
But not sure what I can do with
firstName: speaker.firstName
Suggestions?