I have the following javascript object array:
[ { "firstName": "x", "lastName": "y", "age": 10},
{ "firstName": "x", "lastName": "y", "height": 100},
{ "firstName": "x", "lastName": "y", "weight": 50},
{ "firstName": "a", "lastName": "b", "age": 11},
{ "firstName": "a", "lastName": "b", "height": 110},
{ "firstName": "a", "lastName": "b", "weight": 60},
{ "firstName": "m", "lastName": "n", "age": 12},
{ "firstName": "m", "lastName": "n", "height": 120},
{ "firstName": "m", "lastName": "n", "weight": 70}]
Is it possible to group by firstName and lastName such that it includes other properties of the object in the array?
Expected Array:
[ { "firstName": "x", "lastName": "y", "age": 10, "height": 100, "weight": 50},
{ "firstName": "a", "lastName": "b", "age": 11, "height": 110, "weight": 60},
{ "firstName": "m", "lastName": "n", "age": 12, "height": 120, "weight": 70}]