-1

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:

jsfiddle

rayking
  • 489
  • 4
  • 9
  • 1
    by writing the required code. Let us know what you have tried – sidgate Jan 08 '15 at 09:36
  • possible duplicate of [Remove Duplicates from JavaScript Array](http://stackoverflow.com/questions/9229645/remove-duplicates-from-javascript-array) – Edi G. Jan 08 '15 at 09:37

1 Answers1

0

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.

Community
  • 1
  • 1
Mark Sonn
  • 848
  • 8
  • 22