please help me, I have a function to search for one-dimensional arrays, here are the source codes and their variables:
var fruits= ["Apple","Banana","Grape","Orange"];
function searchStringInArray (src1,fruits)
{
var res=""
for (var j=0; j<src1.length; j++) {
if (src1[j].match (searched))
{
res=res+src1[j]+","
}
}
return res;
}
alert(searchStringInArray (src1,'Grape'));
but I want to modify the function to search for multidimensional arrays, with the following variables:
var fruits= [
["001","Apple","For John"],[["002","Banana","For Stuart"],["003","Grape","For Collins"],["004","Orange","For Ben"]
];
Approximately how the function is suitable for the variable?
fruitsarray.