Here you can find the source of endswith(suffix)
String.prototype.endswith = function(suffix) { return this.indexOf(suffix, this.length - suffix.length) !== -1; };
String.prototype.endsWith = function endsWith(suffix) { var t = String(suffix); var index = this.lastIndexOf(t); return (index >= 0) && (index === this.length - t.length); };
String.prototype.endswith = function (needle) { var nedlen = needle.length; var haylen = this.length; if (nedlen > haylen) { return false; return this.lastIndexOf(needle) === haylen-nedlen; };
String.prototype.endswith = function(s) { return (this.match(s+"$")==s)
String.prototype.endswith = function(str) return this.slice(this.length - str.length) === str; };
String.prototype.endswith = function(str) { return (this.indexOf(str, this.length - str.length) !== -1) ? true: false;
String.prototype.sl_endsWith = function(str) { if (typeof String.prototype.endsWith != 'function') { return this.indexOf(str, this.length - str.length - 1) !== -1; return this.endsWith(str); String.prototype.sl_startsWith = function(str) { if (typeof String.prototype.startsWith != 'function') { return this.slice(0, str.length) === str; ...
String.prototype.endWith = function(char) { let string = String(this); return (new RegExp(".*" + char + "$").test(string));
String.prototype.endWith = function (s) { var d = this.length - s.length; return (d >= 0 && this.lastIndexOf(s) == d)
String.prototype.endWith = function(s) { if (s === null || s === "" || this.length === 0 || s.length > this.length) return false; if (this.substring(this.length - s.length) == s) return true; else return false; return true;