I'm trying to return a value acquired from the following function
function score(string,pattern)
{
counter=0
for(i=0;i<string.length;i++)
{
if(string.toUpperCase().substr(i,pattern.length) == pattern.toUpperCase())
counter++
}
return counter
}
into the following array
result=[]
for(i=0;i<web.length;i++){
result[result.length]=score("Coooool!","OO")
}
such that result=4,4,4 currently, result=4
Any help is appreciated
.push():result.push(score("what","ever"));scoreis required