A
Andrew Poulos
Say I create an array like this:
var p = [];
p[0] = [];
p[0][0] = ["0","1","2","3"];
p[0][1] = ["4","5","6","7"];
p[0][2] = ...
p[1] = [];
p[1][1] = ...
and I've a method which will return the position of the first found
element specified, as an array
Array.prototype.findValue = function(v) {
// blah
};
so
p.findValue("4")
would return
[0,1,1]
how can I then refer to the (sub) array that the return value refers to?
I can pop the return to get [0,1] but I don't know how to translate that
to p[0][1] without building it up manually at the time I need it.
I wishfully thought this might work p[0,1].
Andrew Poulos
var p = [];
p[0] = [];
p[0][0] = ["0","1","2","3"];
p[0][1] = ["4","5","6","7"];
p[0][2] = ...
p[1] = [];
p[1][1] = ...
and I've a method which will return the position of the first found
element specified, as an array
Array.prototype.findValue = function(v) {
// blah
};
so
p.findValue("4")
would return
[0,1,1]
how can I then refer to the (sub) array that the return value refers to?
I can pop the return to get [0,1] but I don't know how to translate that
to p[0][1] without building it up manually at the time I need it.
I wishfully thought this might work p[0,1].
Andrew Poulos