code: function stringEndsWith (str, val, startIndex) {
    var rest = '' + str
    return arguments.length === 1 ? rest.indexOf(val) === rest.length - 1 : rest.substring(0, startIndex).indexOf(val) === startIndex - 1
  }
docs: 判断字符串是否在源字符串的尾部
  
  @param {String} str 字符串
  @param {String/Number} val 值
  @param {Number} startIndex 开始索引
  @return {String}