Javascript String endsWith(passed)
String.prototype.endsWith = function(passed) { return text.indexOf(passed, text.length - passed.length) !== -1; };