1-liners
Version:
Useful oneliners and shorthand functions
24 lines (21 loc) • 617 B
JavaScript
/**
* @module 1-liners/startsWithAt
*
* @description
*
* Same as [`str.startsWith(searchString, position)`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/startsWith).
*
* @example
*
* const startsWithAt = require('1-liners/startsWithAt');
*
* startsWithAt(2, 'liners', '1-liners/startsWithAt'); // => true
* startsWithAt(2, 'stoeffel', 'nope'); // => false
*
*/
;
exports.__esModule = true;
exports["default"] = function (position, searchString, str) {
return str.startsWith(searchString, position);
};
module.exports = exports["default"];