libs/lodash.js
function endsWith(string, target, position) {
      string = string == null ? '' : String(string);
      target = String(target);

      var length = string.length;
      position = (typeof position == 'undefined' ? length : nativeMin(position < 0 ? 0 : (+position || 0), length)) - target.length;
      return position >= 0 && string.indexOf(target, position) == position;
    }
function endsWith(string, target, position) {
      string = string == null ? '' : String(string);
      target = String(target);

      var length = string.length;
      position = (typeof position == 'undefined' ? length : nativeMin(position < 0 ? 0 : (+position || 0), length)) - target.length;
      return position >= 0 && string.indexOf(target, position) == position;
    }
function endsWith ( string , target , position ) { string = string == null ? '' : String ( string ) ; target = String ( target ) ; var length = string . length ; position = ( typeof position == 'undefined' ? length : nativeMin ( position < 0 ? 0 : ( + position || 0 ) , length ) ) - target . length ; return position >= 0 && string . indexOf ( target , position ) == position ; }
Checks if `string` ends with a given target string.

@static
@memberOf _
@category Strings
@param {string} [string=''] The string to search.
@param {string} [target] The string to search for.
@param {number} [position=string.length] The position to search from.
@returns {boolean} Returns `true` if the given string ends with the
target string, else `false`.
@example

_.endsWith('abc', 'c');
// => true

_.endsWith('abc', 'b');
// => false

_.endsWith('abc', 'b', 2);
// => true
Checks if string ends with a given target string .