Difference between revisions of "Array.bykey()"

From ZCubes Wiki
Jump to navigation Jump to search
 
Line 33: Line 33:
 
etc
 
etc
 
a=MS(4);
 
a=MS(4);
a=a.concat([[8,3,4,5]]);
+
a=a.concat([8,3,4,5]);
 
a.bykey(1);
 
a.bykey(1);
  

Latest revision as of 03:38, 16 April 2020

bykey

Create an object with elements of array bucketed with the key specified.

Example

a=#TABLE1;

a.bykey(0)

{ "Amino Acid": [ [ "Amino Acid", "Symbol", "SLC", "DNA codons" ] ], "Isoleucine ": [ [ "Isoleucine ", "Ile", "I", "ATT, ATC, ATA" ] ],

etc a=MS(4); a=a.concat([8,3,4,5]); a.bykey(1);

{"3": [ [ 13, 3, 2, 16 ], [ 8, 3, 4, 5 ] ], "6": [ [ 12, 6, 7, 9 ] ], "10": [ [ 8, 10, 11, 5 ] ], "15": [ [ 1, 15, 14, 4 ] ] }

See Also