code: function indexOf(word, p, c) {
      var j = 0;
      while ((p + j) <= word.length) {
        if (word.charAt(p + j) == c) return j;
        j++;
      }
      return -1;
    }
docs: cheaper version of indexOf; instead of creating each iteration new str.