Created
October 2, 2012 17:26
-
-
Save wayneashleyberry/3821399 to your computer and use it in GitHub Desktop.
javascript endsWith function
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String.prototype.endsWith = function (str) { | |
if (this.substr(-str.length) === str) { | |
return true; | |
} | |
return false; | |
}; |
assertchris
commented
Oct 2, 2012
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment