function mutation(arr) {
arr[0] = arr[0].toLowerCase();
arr[0] = arr[0].split("");
arr[1] = arr[1].toLowerCase();
arr[1] = arr[1].split("");
console.log(arr[0]);
console.log(arr[1]);
for (let i=0; i<arr[1].lengtth; i++){
if (!arr[0].includes(arr[1][i])){
return false;
}
}
return true;
}
mutation(["HELLO", "HEY"]);
It would work in all cases if you checked your spelling of the word “length”
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.