AnsweredAssumed Answered

Return the array based on the maximum value

Question asked by pho@siteone.com on Aug 20, 2018
Latest reply on Aug 21, 2018 by pho@siteone.com

Just curious how one would be able to perform this logic.  Below is a sample array and what I want is return the array that holds the maximum price.

 

[
{
"skuId" : "123",
"price" : "50.00"
},

"skuId" : "123",
"price" : "51.00"
},
{
"skuId" : "456",
"price" : "34.00"
}

]

 

Return:

[
{
"skuId" : "123",
"price" : "51.00"
},"skuId" : "456",
"price" : "34.00"
}

]

Outcomes