Javascript String endsWith(string)
String.prototype.endsWith = function (string) { var index = arguments.length < 2 ? this.length : arguments[1]; var foundIndex = this.lastIndexOf(string); return foundIndex !== -1 && foundIndex === index - string.length; };
String.prototype.endsWith = function (string) { var index = arguments.length < 2 ? this.length : arguments[1]; return this.indexOf(string) === index - string.length; };
String.prototype.endsWith = function (string) { var index = arguments.length < 2 ? this.length : arguments[1]; var foundIndex = this.indexOf(string); return foundIndex !== -1 && foundIndex === index - string.length; };
// String.prototype.endsWith String.prototype.endsWith = function (string) { var index = arguments.length < 2 ? this.length : arguments[1]; return this.indexOf(string) === index - string.length; };