Intern — Middle
Counting the total weight of goods based on specified conditions
livecode
Task condition
Determine the total weight of all items with a price exceeding 80 and a quantity less than 7.
const food = [
{name: "Bolognese Pasta", weight: 350, price: 68, quantity: 10},
{name: "Vegetable Spaghetti", weight: 350, price: 56, quantity: 8},
{name: "Penne with Chicken Fillet", weight: 400, price: 68, quantity: 16},
{name: "Chicken Pizza with Pineapple", weight: 675, price: 139, quantity: 30},
{name: "Four Seasons Pizza", weight: 1600, price: 339, quantity: 8},
{name: "Italian Pizza", weight: 740, price: 159, quantity: 1},
{name: "Jonathan Salad with Salmon", weight: 230, price: 77, quantity: 41},
{name: "Caesar Salad with Shrimp", weight: 230, price: 69, quantity: 5}
];