MCPcopy Create free account
hub / github.com/OpenEndedGroup/Field2 / endsWith

Function endsWith

lib/web/jshint.js:11645–11656  ·  view source on GitHub ↗

* Checks if `string` ends with the given target string. * * @static * @memberOf _ * @category String * @param {string} [string=''] The string to search. * @param {string} [target] The string to search for. * @param {number} [position=string.length] The position to

(string, target, position)

Source from the content-addressed store, hash-verified

11643 * // => true
11644 */
11645 function endsWith(string, target, position) {
11646 string = baseToString(string);
11647 target = (target + '');
11648
11649 var length = string.length;
11650 position = position === undefined
11651 ? length
11652 : nativeMin(position < 0 ? 0 : (+position || 0), length);
11653
11654 position -= target.length;
11655 return position >= 0 && string.indexOf(target, position) == position;
11656 }
11657
11658 /**
11659 * Converts the characters "&", "<", ">", '"', "'", and "\`", in `string` to

Callers 1

jshint.jsFile · 0.85

Calls 2

baseToStringFunction · 0.85
indexOfMethod · 0.80

Tested by

no test coverage detected