根據病情唯一值的對象數組:獲取包含從我有包含我的產品的信息對象的數組如下現有對象數組
var products = [{ProductID: 1, Product Name:"Toy Car", Price: 250},
{ProductID: 2, Product Name:"TriCycle", Price: 1250},
{ProductID: 1, Product Name:"Toy Car", Price: 450},
{ProductID: 3, Product Name:"Feeding Chair", Price: 1700},
{ProductID: 3, Product Name:"Feeding Chair", Price: 2200},
{ProductID: 1, Product Name:"Toy Car", Price: 500},
{ProductID: 2, Product Name:"Tricycle", Price: 1020},
{ProductID: 4, Product Name:"Baby swing", Price: 430},
{ProductID: 4, Product Name:"Baby swing", Price: 550}]
現在我想獲得對象的數組包含具有最低的價格獨特的產品名稱如下
var UniqueProducts = [{ProductID: 1, Product Name:"Toy Car", Price: 250},
{ProductID: 2, Product Name:"TriCycle", Price: 1020},
{ProductID: 3, Product Name:"Feeding Chair", Price: 1700},
{ProductID: 4, Product Name:"Baby swing", Price: 430}]
有沒有因爲我不想來分析每一個項目在數組中(使用循環),可以實現這個結果的直接陣列功能?