Why doesn’t this work?
Your code so far
function mutation(arr) {
var testStr = arr[0].toLowerCase().split("");
var testRegex = arr[1].toLowerCase().split("");
for(var i = 0; i < testRegex.length; i++){
if(testStr.indexOf(testRegex[i]) == true){
return true;
} else return false;
}
}
mutation(["hello", "Hello"]);
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.80 Safari/537.36
.
Link to the challenge:
https://learn.freecodecamp.org/javascript-algorithms-and-data-structures/basic-algorithm-scripting/mutations/