Skip to content

Instantly share code, notes, and snippets.

@jongha
Created December 28, 2018 13:53
Show Gist options
  • Select an option

  • Save jongha/eb4406135cda219664962cfa1e4268ba to your computer and use it in GitHub Desktop.

Select an option

Save jongha/eb4406135cda219664962cfa1e4268ba to your computer and use it in GitHub Desktop.
String.prototype.startsWith for IE
if (!String.prototype.startsWith) {
String.prototype.startsWith = function(searchString, position) {
position = position || 0;
return this.indexOf(searchString, position) === position;
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment