Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Javascript
Using an array to reference a different array
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Andrew Poulos, post: 4982417"] 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 [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Javascript
Using an array to reference a different array
Top