Javascript String endsWith(end)
String.prototype.endsWith = function(end) { return this.indexOf(end) == this.length-end.length; };