I have an array of objects with the following structure
[{'list': 'one', 'item': 1},
{'list': 'one', 'item': 2},
{'list': 'one', 'item': 3},
{'list': 'two', 'item': 1},
{'list': 'two', 'item': 2}]
Now I need to reformat it as shown below
[{'one': [1, 2, 3]},
{'two': [1, 2]}]
What is the most efficient way to achieve this transformation using the Array.map function?