📅  最后修改于: 2022-03-11 14:58:42.979000             🧑  作者: Mango
let items = [
{
itemName: "Effective Programming Habits",
type: "book",
price: 13.99
},
{
itemName: "Chromebook 2",
type: "computer",
price: 399.99
},
{
itemName: "Programming 101",
type: "book",
price: 15.00
}
]
let maxItem = items.reduce((max, min) => max.price > min.price ? max : min);
console.log(maxItem.itemName) //Chromebook 2
console.log(maxItem) //Full object