|
Hi i am confused in one topic and need help,
I have a javascript array containing objects like;
TYPE AMOUNT COUNT
Object 1 => ("A" , 100 ,10)
Object 2 => ("C" , 50 ,10)
Object 3 => ("A" , 100 ,20)
Object 4 => ("B" , 200 ,10)
Object 5 => ("A" , 10 ,10)
Object 6 => ("B" , 100 ,10)
Object 7 => ("C" , 100 ,5)
Object 8 => ("C" , 50 ,5)
In the end i want to group these objects like ;
("A" , 100,30) (Note : 30 = 20 +10)
("A" , 10,10)
("B" , 200,10)
("B" , 100,10)
("C" , 100,5)
("C" , 50,15) 15 = 10 + 5
How can i do this in javascript, note that the new types will be added to this array ?
|
|
|
|
|