|
-
January 24th, 2008, 11:44 AM
#19
Re: remove duplicates and sort array
No, just one array.
If I understand correctly your code is supposed to loop through the relevant dimension of the array and return an array with out the duplicates.
Either I am passing in the index and dimension incorrectly or I am not using the function correctly?
By passing in unique(array[0],false) it seems to assume that I mean index 0 (row) whereas I am trying to get it to look through dimension 0 (column).
For example in this array:
Code:
var testArray = [
[3, "Infrastructure", "SY400", "SY410", "SY414", "ZACY"],
[5, "Regions", "SY600", "SY610", "SY610", "ZALY"],
[3, "Infrastructure", "SY400", "SY410", "SY410", "ZAVI"],
[4, "Management", "SY300", "SY340", "SY344", "ZBBC"],
[1, "Central Services", "SY700", "SY700", "SY700", "ZBDX"],
[4, "Management", "SY300", "SY340", "SY345", "ZBFP"],
[3, "Infrastructure", "SY400", "SY440", "SY440", "ZBHX"]
];
I want to pass in the reference to [0] so it returns an arry with 3,5,4,1 instead of 3,5,3,4,1,4,3
except it only returns the value 3 and stops at that.
Do I need to loop through and run unique multiple times or do I need to loop through the returned array?
Either way I am not passing in the right references somewhere...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|