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

Function startsWith

lib/web/jshint.js:11980–11987  ·  view source on GitHub ↗

* Checks if `string` starts 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=0] The position to search fro

(string, target, position)

Source from the content-addressed store, hash-verified

11978 * // => true
11979 */
11980 function startsWith(string, target, position) {
11981 string = baseToString(string);
11982 position = position == null
11983 ? 0
11984 : nativeMin(position < 0 ? 0 : (+position || 0), string.length);
11985
11986 return string.lastIndexOf(target, position) == position;
11987 }
11988
11989 /**
11990 * Creates a compiled template function that can interpolate data properties

Callers 1

jshint.jsFile · 0.85

Calls 2

baseToStringFunction · 0.85
indexOfMethod · 0.80

Tested by

no test coverage detected