Tests pass except for the capital letters for Mutations

For some reason, toLowerCase() won’t work for the individual characters in arr[1]. It works when I put variables for them but it doesn’t when I don’t set them to var.

function mutation(arr) {



   for (var i = 0; i < arr[1].length; i++) {

     if (arr[0].indexOf(arr[1][i]) == -1) {

       return false;

     else {




 return true;


String function toLowerCase does not change your string. It returns a new string that you will have to capture in a variable.

var myString = "You're Almost There!";
var newString = myString.toLowerCase();
console.log(myString);  // "You're Almost There!" - unchanged even after .toLowerCase()
console.log(newString); // "you're almost there!" - saved changes to a new string

// saved changes to array of strings
var newArray = myString.toLowerCase().split("");
// ["y", "o", "u", "'", "r", "e", " ", "a", "l", "m", "o", "s", "t", " ", "t", "h", "e", "r", "e", "!"]
1 Like

I’ve edited your post for readability. When you enter a code block into the forum, precede it with a line of three backticks and follow it with a line of three backticks to make easier to read. See this post to find the backtick on your keyboard. The “preformatted text” tool in the editor (</>) will also add backticks around text.


Thank you very much!