code: function endsWith(target, searchString, position) {
    position = position || target.length;
    position = position - searchString.length;
    let lastIndex = target.lastIndexOf(searchString);
    return lastIndex !== -1 && lastIndex === position;
  }
docs: Adapted from String.prototype.endsWith polyfill.