Tell us what’s happening:
Here is my code:
function mutation(array) {
haystack = array[0].toLowerCase();
needle = array[1].toLowerCase();
for (char in needle) {
if (!haystack.includes(needle[char])) {
return false;
}
}
return true;
}
none of the tests in the https://www.freecodecamp.org/learn/full-stack-developer/lab-mutations/implement-the-mutations-algorithm UI pass, but when i run them in VS code by adding console.log for each test they pass.
What am i doing wrong?
Your code so far
function mutation(array) {
haystack = array[0].toLowerCase();
needle = array[1].toLowerCase();
for (char in needle) {
if (!haystack.includes(needle[char])) {
return false;
}
}
return true;
}
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36
Challenge Information:
Implement the Mutations Algorithm - Implement the Mutations Algorithm