Skip to content

Instantly share code, notes, and snippets.

@morbidcamel101
Created March 6, 2017 21:31
Show Gist options
  • Save morbidcamel101/8902be532d46947cf0c00a4268dc4500 to your computer and use it in GitHub Desktop.
Save morbidcamel101/8902be532d46947cf0c00a4268dc4500 to your computer and use it in GitHub Desktop.
End with string extension
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