I am trying to destructure an object. There is an array of objects I would like to pull into the assignment. Do I have to do a reduce on the array?
I tried to destructure the object but it only shows the first object in the Shoes Array.
const currentInventory = [
{
name: 'Brunello Cucinelli',
shoes: [
{name: 'tasselled black low-top lace-up', price: 1000},
{name: 'tasselled green low-top lace-up', price: 1100},
{name: 'plain beige suede moccasin', price: 950},
{name: 'plain olive suede moccasin', price: 1050}
]
},
{
name: 'Gucci',
shoes: [
{name: 'red leather laced sneakers', price: 800},
{name: 'black leather laced sneakers', price: 900}
]
}
];
for(var{name:designerName, shoes:[{name:shoeName,price}]} of currentInventory){
console.log (designerName, shoeName, price)
}