Answers for "max value array of object javascript"

3

How to find the max id in an array of objects in JavaScript

const shots = [
  {id: 1, amount: 2},
  {id: 2, amount: 4},
  {id: 3, amount: 52},
  {id: 4, amount: 36},
  {id: 5, amount: 13},
  {id: 6, amount: 33}
];

shots.reduce((acc, shot) => acc = acc > shot.amount ? acc : shot.amount, 0);
Posted by: Guest on March-06-2020
7

javascript array find highest value of array of objects by key

Math.max.apply(Math, array.map(function(o) { return o.y; }))
Posted by: Guest on March-05-2020
1

filter biggest value javascript object

const max = data.reduce((prev, current) => (prev.y > current.y) ? prev : current)
Posted by: Guest on October-31-2020
-1

max value array of object javascript

Math.max(...arr.map({ value } => value));
Posted by: Guest on December-17-2020

Code answers related to "max value array of object javascript"

Code answers related to "TypeScript"

Browse Popular Code Answers by Language