How can I Sort this array into second one
▼2 up and 0 down, posted by
2 up and 0 down, posted by
``` I have a problem like this .... i have a array like 1st one and need to convert into second one How can i do that ??? [ {'bike':'Fzs', 'modelId':'5', 'red'}, {'bike':'Fzs', 'modelId':'6', 'blue'}, {'bike':'Fzs', 'modelId':'5', 'black'}, {'bike':'Fzs', 'modelId':'5', 'red'}, {'bike':'Fzs', 'modelId':'6', 'blue'}, {'bike':'Fzs', 'modelId':'5', 'red'}, {'bike':'Fzs', 'modelId':'7', 'black'}, {'bike':'Fzs', 'modelId':'6', 'purple'}, {'bike':'Fzs', 'modelId':'7', 'black'}, {'bike':'Fzs', 'modelId':'5', 'red'} ] ***INTO*** [ {'bike':'Fzs', 'modelId':'5', 'red', 'qty':'3'}, {'bike':'Fzs', 'modelId':'5', 'black', 'qty':'1'}, {'bike':'Fzs', 'modelId':'6', 'blue', 'qty':'2'}, {'bike':'Fzs', 'modelId':'6', 'purple', 'qty':'1'}, {'bike':'Fzs', 'modelId':'7', 'black', 'qty':'2'} ] ```