Q: Javascript Arrays
Q: Javascript Arrays
Out of context: Reply #12
- Started
- Last post
- 17 Responses
- E__________0
if you are worried about your script slowing down a client this will make it faster:
var n=0;
my_array.sort();
while(my_array[n] == 1)
{
my_array2.push(my_array[n]);
n++;
}
obviously 1 should be the lowest value, if not (0 is the lowest) use a for loop and break when the number is not 1 anymore.