Hi. I am trying to solve an exercise where an array is provided. the array contain two strings. The exercise consists in verify if the letters of the second string of the array is included or not in the first string of the array., if it is the case return true and is is not it should return false. My function works wit all test case except one when the array provided is [“hello”, “hey”]. I want to know if it is something wrong with my code because I dont understand why it works with all the other cases except the mentioned.
**This is the code**
function mutation(arr) {
let firstWord = arr[0].toLowerCase()
let secondWord = arr[1].toLowerCase()
let isIncluded = null
for (let i = 0; i < secondWord.length-1; i++) {
if (firstWord.includes(secondWord.charAt(i)) === true) {
return isIncluded = true
}
return isIncluded = false
}
return isIncluded
}
mutation([“hello”, “hey”]);
**Your browser information:**
**Challenge:** Mutations
**Link to the challenge:**
https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/basic-algorithm-scripting/mutations