String.prototype.endWith =
function
(s) {
var
d =
this
.length - s.length;
return
(d >= 0 &&
.lastIndexOf(s) == d)
}