Looking to transform this simplified array of objects:
var items = [{"function":"function_1","process":"process_1"}, {"function":"function_1","process":"process_2"}, {"function":"function_1","process":"process_3"}, {"function":"function_2","process":"process_3"}, {"function":"function_2","process":"process_4"}]
into a new array based on the keys, resulting in:
result = [
{
"function":"function_1",
"process": [
"process_1",
"process_2"
]
},
{
"function":"function_2",
"process": [
"process_3",
"process_4"
]
}
]