if (typeof String.prototype.endsWith !== 'function') {
    String.prototype.endsWith = function (s) {
        if (s.length > this.length) {
            return false;
        }