Tell us what’s happening:
Hello Everyone,
Another noob question.
I’m stuck. When returning the result variable I get the matching index values. What is the best way to convert these values back to a string for comparison? or am I going about this the wrong way?
Thank you in Advance for your feedback!
Your code so far
function mutation(arr) {
var a = arr[0].toLowerCase();
var b = arr[1].toLowerCase();
var result = "";
for(var i = 0; i<b.length; i++){
result += a.indexOf(b[i]);
}
return result;
}
mutation(["Alien", "line"]);
Your browser information:
Your Browser User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36
.
Link to the challenge:
https://www.freecodecamp.org/challenges/mutations