I've got an array of objects:
[
{
questionId: 1,
delta: 3,
},
{
questionId: 3,
delta: 11,
},
{
questionId: 6,
delta: 11,
}
....
]
With up to 43 entries.
To get the entry with the highest delta out of this, I would do something like
const maxDelta = Math.max.apply(Math, array.map(question=> {
return question.delta;
}));
But now I need the 10 highest delta's out of this array. How would I do that?