There is nested names array with only strings, need to loop through to find how many times each string appears. Since two elements have "bob" resulting function should return 2. How to search for the string even if array is nested?
var names = ["bob", ["steve", "michael", "bob", "chris"]];
function loop(){
/* .... */
}
var result = loop(names, "bob");
console.log(result); // 2
"bob"" - Are you trying to return the total number of"bob"strings, or the total number of elements that contain a"bob"string?