bape
August 30, 2004, 3:13pm
1
I found the tutorial about getting the index of something in an array, but i need the same for a twodimensional array, so i get [0][1] for example. How do i alter this code to do so?
Array.prototype.getIndex = function(data) {
for (i=0; f=0; i<this.length; ++i; ) {
if (this* == data) {
return i;
}
}
return -1;
};
system
August 30, 2004, 4:04pm
2
bape:
I found the tutorial about getting the index of something in an array, but i need the same for a twodimensional array, so i get [0][1] for example. How do i alter this code to do so?
Array.prototype.getIndex = function(data) {
for (i=0; f=0; i<this.length; ++i; ) {
if (this* == data) {
return i;
}
}
return -1;
};
maybe
Array.prototype.getIndex = function(dat) {
for (i=0; i<this.length; i++) {
for (j=0; j<this*.length; j++) {
if (this*[j] == dat) {
trace(i+" "+j);
}
}
}
};