It's as simple as iterating the array and looking for the regexp
function searchStringInArray (stringArray) { for (var j=0; j<stringArray.length; j++) { if (stringArray[j].match ("height")) return j; } return -1; } It's as simple as iterating the array and looking for the regexp
function searchStringInArray (stringArray) { for (var j=0; j<stringArray.length; j++) { if (stringArray[j].match ("height")) return j; } return -1; }