Error on Mutations

please help me with this error: TypeError : Cannot read property 'length' of undefined

...

function mutation(arr,char) {
for(var i=0; i< char.length; i++)
{
if(arr.indexOf(char[i] = -1))
{
return false;
}
}
return true;
}
mutation([“hello”, “hey”])

You are passing 1 parameter.

function mutation(arr,char) {
function expects 2.
That is the problem.

1 Like

yes! i got it thank you

1 Like