I have an array of items with this structure:
originalArray = [
{
product: { price: 10},
shipping: {...}
},
{
product: {price: 20},
shipping: {...},
}
]
I want to make a new array that is just the products from each original array item, like:
[ {price: 10}, {price: 20} ]
Using javascript (es6/2015 is fine)
What's the fastest way to do this? Is there any way to do it without a loop / map? The amount of items in the array will be dynamic / I will not know how many there might be.