how to new an array base on another array,and delete duplicate value.and change value
originalData = [{id:1,count:1},{id:1,count:1},{id:1,count:1},{id:2,count:1}];
newData = [{id:1,count:3},{id:2,count:1}]
i tried this:
how to new an array base on another array,and delete duplicate value.and change value
originalData = [{id:1,count:1},{id:1,count:1},{id:1,count:1},{id:2,count:1}];
newData = [{id:1,count:3},{id:2,count:1}]
i tried this:
If I understand correctly, I have needed to do this before too and I remember your question being answered here: Remove Duplicates from JavaScript Array
You just need to modify the code slightly. If you need help with that change your question.