title: Why indexOf in javascript not working?
body: <p>I'm not sure what I'm doing wrong here. The first instance that I use indexOf it works perfectly fine, but when I use it the second time it's not returning the result that I'm expecting.</p>
  
  <pre><code>function mutation(arr) {
      //return arr;
      res = "";
      for (var x=0; x&lt;arr[1].split("").length; x++) {
          if (arr[0].indexOf(arr[1].split("")[x]) !== -1) {
              res += "t";
          } else {
              res += "f";
          }
      }
      // res = ttt
      if (res.indexOf("f") !== -1) {
          return true;
      } else {
          return false;
      }
  }
  
  mutation(["hello", "hey"]);
  // this returns true instead of false
  mutation(["floor", "loo"]); 
  // returns false instead of true
  </code></pre>
  
  <p>mutation should return false if an element from arr[1] is not present in arr[0] else return true.</p>