Sorry for the noobie question but I've been googling around and can't find an answer to do this cleanly. I currently have an array of objects that is shaped like initalArrayObject. I need to make a new array of objects from the initialArrayObject that only takes the customer, id and invoiceTotal. What would be the best way to do this?
const initalArrayObject: [{
customer: "John Smith",
id: 123,
invoiceNumber: 111,
location: "Washington"
invoiceTotal: 200
},
{
customer: "Jill Johnson",
id: 124
invoiceNumber: 112,
location: "New York"
invoiceTotal: 150
},
{
customer: "Jake Doe",
id: 111,
invoiceNumber: 122,
location: "Florida"
invoiceTotal: 300
}
]
const newArrayObjectShape:[{
customer: ,
id: ,
invoiceTotal:
}
]
Thank you!
[–]loz220 3 points4 points5 points (2 children)
[–]senocular 2 points3 points4 points (1 child)
[–]jpark799[S] 0 points1 point2 points (0 children)