skip to Main Content

group array and join strings Javascript

I have an array that looks something like this: let result = [{"Person": "Bob","Wants":"Shoes"}, {"Person": "Bob","Wants":"Socks"}, {"Person": "Sam","Wants":"Coffee"}, {"Person": "Tim","Wants":"Puppy"}, {"Person": "Sam","Wants":"Biscuit"}]; I would like to convert it into an array that looks like this: let summary = [{"Person":"Bob","Wants":"Shoes, Socks"},…

VIEW QUESTION
Back To Top
Search