I don’t understand, why why the compiler throws an error “TypeError: unknown: undefined has no properties”. The site pytotutor all works fine.
function mutation(arr) {
var arr1 = arr.shift().toString().split('');
var arr2 = arr.pop().toString().split('');
var post = arr2.length;
var cash = 0;
var count = 0;
for (var i = 0; i < arr2.length; i++) {
cash = arr2[i];
for (var a = 0; a < arr1.length; a++)
if (cash == arr1[a]) {
count++;
}
}
if (count == post){
return true;
} else {
return false;
}
}
mutation(["hello", "Hello"]);
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:69.0) Gecko/20100101 Firefox/69.0
.
Link to the challenge: