Skip to content

Instantly share code, notes, and snippets.

@anurag-majumdar
Created September 16, 2018 11:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anurag-majumdar/28f7b96d1e4cda3138de6b4df8b08334 to your computer and use it in GitHub Desktop.
Save anurag-majumdar/28f7b96d1e4cda3138de6b4df8b08334 to your computer and use it in GitHub Desktop.
if (!String.prototype.startsWith) {
String.prototype.startsWith = function (searchString, position) {
position = position || 0;
return this.substr(position, searchString.length) === searchString;
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment