codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  Grouping javascript object arrays  HighHopes at 22:38 on Sunday, December 20, 2009
 

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 ?

















CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums








Recent Forum Threads
•  PING PROGRAM IN PERL
•  Need Help with a Regular Expression
•  Informations on HTML
•  Re: FREE TV on your PC!
•  Re: Using Lucene or Solr ?
•  submit button on html form
•  Re: Browse button /filedialog in perl tk:
•  how to create forum using C# code
•  Re: Perl array access


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2010