function match(str1, str2) {
var matched = false
for (i in str1) {
if (str1[i] == str2[0]) {
for (j in str2) {
if (str2[j] != str1[i]) {
return false
} else {
i++
matched = true
}
}
}
return matched
}
}
console.log(match("umbrella", "rella"))
Can someone fix this code. Is this piece of code good enough. or any improvements. I wanted to find a string in another string with just using the for loops. I saw some answers but they were too complex.
Im a beginner