00001 var baseClamp = require('./_baseClamp'), 00002 baseToString = require('./_baseToString'), 00003 toInteger = require('./toInteger'), 00004 toString = require('./toString'); 00005 00029 function startsWith(string, target, position) { 00030 string = toString(string); 00031 position = position == null 00032 ? 0 00033 : baseClamp(toInteger(position), 0, string.length); 00034 00035 target = baseToString(target); 00036 return string.slice(position, position + target.length) == target; 00037 } 00038 00039 module.exports = startsWith;