If I have this object:
const json = {
products: [
{
id: 0,
name: "Chair Roby",
style: "Leather",
color: "red",
}
]
};
I can map over the array inside of it and show all the items in the object inside the array like this:
const prod = json.products.map(item => {
return (
<ul>
<li>
{item.name}
</li>
<li>
{item.style}
</li>
<li>
{item.color}
</li>
</ul>
);
});
This listed me the values, but how could I show also the keys such as name, style and color?