I want to join the rest of the values with the same key in the Javascript object. want to solve it using vanilla script or lodash..
example:
obj = [
{ M: 'M1', F: '123-test-123', CODE: 'A' },
{ M: 'M1', F: '123-test-123', CODE: 'B' },
{ M: 'M1', F: '123-test-123', CODE: 'C' },
{ M: 'M2', F: '123-test-456', CODE: 'A' },
{ M: 'M2', F: '123-test-456', CODE: 'A' }
...
]
Run Code Online (Sandbox Code Playgroud)
desired result:
obj = [
{ M: 'M1', …Run Code Online (Sandbox Code Playgroud)