1var result = array.reduce( (acc, o) => (acc[o.name] = (acc[o.name] || 0)+1, acc), {} );
2
1var array =
2 [
3 {"name":"abc","age":20}
4 {"name":"abc","age":20}
5 {"name":"abc","age":20}
6 {"name":"xyz","age":21}
7 {"name":"xyz","age":21}
8 ]
9