Skip to content

Instantly share code, notes, and snippets.

@stefano-bortolotti
Created October 13, 2013 17:29
Show Gist options
  • Save stefano-bortolotti/6964923 to your computer and use it in GitHub Desktop.
Save stefano-bortolotti/6964923 to your computer and use it in GitHub Desktop.
Javascript String ends with function
String.prototype.endsWith = function(suffix) {
return this.indexOf(suffix, this.length - suffix.length) !== -1;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment