rome_castillo
10 years agoOccasional Contributor
Can I pass the object Property Name as a parameter
I have used FindAllChildren to get all the children of a window object and put it in an array (objArray). I am trying to pass the Property Name (myName) and Property Value (myValue) to find the ind...
- 10 years ago
function getIndex(objArray, myName, myValue) { for(var i = 0; i < objArray.length; i++){ if(objArray[i][myName] == myValue){ //do stuff
} { }