endsWith = (str, searchString, position) => {
  str = String(str);
  if (position === undefined || position > str.length) {
    position = str.length;
  }
  position -= searchString.length;
  const lastIndex = str.indexOf(searchString, position);
  return lastIndex !== -1 && lastIndex === position;
}
Determines whether a string ends with the characters of a specified string

@param {String} str
@param {String} searchString
@param {Number} [position= 0]

@returns {boolean}