I have the following data
shots = [ {id: 1, amount: 2}, {id: 2, amount: 4} ]
Now I\'m trying to get the object which
Try this:
Updated
let highest = shots.reduce((max, shot) => { return shot.amount > max.amount ? shot : max }, {amount:0});