|
-
prototype - find string in array?
I have a multidimensional array
arrMenu=new Array()
arrMenu.header="header"
arrMenu[0]=new Array()
arrMenu[0].header="header0"
arrMenu[0][0]=new Array()
arrMenu[0][0].header="header0-0"
arrMenu[0][1]=new Array()
arrMenu[0][1].header="header0-1"
arrMenu[1]=new Array()
arrMenu[1].header="header1"
arrMenu[1][0]=new Array()
arrMenu[1][0].header="header1-0"
arrMenu[1][1]=new Array()
arrMenu[1][1].header="header1-1"
arrMenu[1][2]=new Array()
arrMenu[1][2].header="header1-2"
I wish to have my prototype search for a string and return an array of indexes.
E.g. if I search for "header1-1" the prototype should return
arrMenuPos=[1,1]
I am having trouble looping through a multidimensional array
Any help out there?
Regards
Podenphant
*******
Array.prototype.stringInArray = function (str){
??????? uaaargh 
}
*******
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
|