Javascript String endsWith(s)
// <string>.endsWith( < string for comparason > ) String.prototype.endsWith = function(s) { return this.length >= s.length && this.substr(this.length - s.length) == s; }
String.prototype.endsWith = function(s) { var d = this.length - s.length; return d >= 0 && this.lastIndexOf(s) === d; }
String.prototype.endsWith = function(s){ return this.indexOf(s) == this.length - s.length; };