var developers = [
{ name: "Joe", age: 23 ,overallLevel: "high"},
{ name: "Sue", age: 28 ,overallLevel: "advanced" },
{ name: "Jon", age: 32 ,overallLevel: "high" },
{ name: "Bob", age: 24 ,overallLevel: "high" },
{ name: "Bob", age: 20 ,overallLevel: "advanced" }
]
Need count of overallLevel in the mentioned array using array.reduce() [high:3, advanced:2]
You could just count them with an object.
Try this (you need no
array.reduce()
to do that):