isSubstringInArray = function isSubstringInArray(str, arr) {
  for (var i = 0; i < arr.length; i++) {
    if (arr[i].match(str)) return i;
  }

  return -1;
}
@function isSubstringInArray
Detects whether a substring in present in a given array
@param {string} str The substring to detect
@param {array} arr The array to search
@returns {number} the array index containing the substring or -1 if not present