Skip to content

Instantly share code, notes, and snippets.

@ziphirum
Created August 6, 2014 15:07
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 ziphirum/13cec115ff43f4ad0cdb to your computer and use it in GitHub Desktop.
Save ziphirum/13cec115ff43f4ad0cdb to your computer and use it in GitHub Desktop.
Check string startWith
if (typeof String.prototype.startsWith != 'function') {
String.prototype.startsWith = function (str){
return this.lastIndexOf(str, 0) === 0
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment