Using info returned from an API in the form of JSON, I am trying to manipulate the following data:
"results": [
{
"url": "etcetc",
"id": 1,
"user": {
"url": "etcetc",
"id": 2,
"email": "[email protected]",
"username": "example",
"first_name": "mister",
"last_name": "sample"
},
"data1": "String",
"data2": 10,
"data3": 6,
"data4": 12000,
"data5": 0.3333333333333333
}
so there are several objects returned under "results", and each object has its own set of data1-5. Using Angular, what is the best way to search for the object with the highest data5, and return the rest of the info for that particular object? So I'd print out data1-5 for the array object with the highest data5 value, if that makes sense.