1const shots = [
2 {id: 1, amount: 2},
3 {id: 2, amount: 4},
4 {id: 3, amount: 52},
5 {id: 4, amount: 36},
6 {id: 5, amount: 13},
7 {id: 6, amount: 33}
8];
9
10shots.reduce((acc, shot) => acc = acc > shot.amount ? acc : shot.amount, 0);
11
1var peopleData = [
2 { name: "Paul", height: 180, age: 21 },
3 { name: "Johnny", height: 198, age: 43 },
4 { name: "Brad", height: 172, age: 49 },
5 { name: "Dwayne", height: 166, age: 15 }
6];
7
8//Find biggest height number
9var maxHeight = 0;
10
11for (var i = 0; i < heights.length; i++) {
12 if (peopleData[i].height > maxHeight) {
13 maxHeight = peopleData[i].height;
14 }
15}
1const max = data.reduce((prev, current) => (prev.y > current.y) ? prev : current)
2