I am working on a javascript problem and was given this code as part of it and was told it was an array. /* here is the array used for project 1 */ const cart = [ { product: { title: "Portrait of Marten Soolmans", filename: "105070.jpg", price: 75.0 }, quantity: 3 }, { product: { title: "View of Houses in Delft", filename: "106060.jpg", price: 125.0 }, quantity: 1 }, { product: { title: "Woman Reading a Letter", filename: "106050.jpg", price: 100.0 }, quantity: 2 }, ]; This is not like a normal array. How do I use it like an array and access the values of the variables?
I am working on a javascript problem and was given this code as part of it and was told it was an array.
/* here is the array used for project 1 */
const cart = [
{
product: {
title: "Portrait of Marten Soolmans",
filename: "105070.jpg",
price: 75.0
},
quantity: 3
},
{
product: {
title: "View of Houses in Delft",
filename: "106060.jpg",
price: 125.0
},
quantity: 1
},
{
product: {
title: "Woman Reading a Letter",
filename: "106050.jpg",
price: 100.0
},
quantity: 2
},
];
This is not like a normal array. How do I use it like an array and access the values of the variables?

Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 6 images









