text: Q:
  
  JavaScript Algorithm Scripting
  
  I'm doing the exercises on freeCodeCamp and have stuck on this task:
  
  Return true if the string in the first element of the array contains
    all of the letters of the string in the second element of the array.
  For example, ["hello", "Hello"], should return true because all of the
    letters in the second string are present in the first, ignoring case.
  The arguments ["hello", "hey"] should return false because the string
    "hello" does not contain a "y".
  
  My code is fully working except this arguments: ["hello", "hey"]
  Please, help me to understand what is the problem.
  My code:
  function mutation(arr) {
    let arr1 = arr[0].toLowerCase();
    let arr2 = arr[1].toLowerCase();
  
    for (let i = 0; i < arr2.length; i++) {
      if (arr1.indexOf(arr2[i]) > -1) {
        return true;
      } else {
        return false;
      }
    }
  
  }
  mutation(["hello", "hey"]);
  
  A:
  
  You are returning in the first iteration of your for loop regardless of whether the loop is finished or not. You want to go all the way through the loop unless you find a reason to return (like you didn't find a letter). If you make it through the loop you're good and can return true.
  
  function mutation(arr) {
    let arr1 = arr[0].toLowerCase();
    let arr2 = arr[1].toLowerCase();
  
    for (let i = 0; i < arr2.length; i++) {
      if (arr1.indexOf(arr2[i]) == -1) {
        return false;  // found a false value, you can return
      }
    }
    return true  // made it through the loop without finding a false value.
  
  }
  console.log(mutation(["hello", "hey"]));
  console.log(mutation(["hello", "HEllo"]));
  
  