if (!String.prototype.replaceLast) {
        String.prototype.replaceLast = function(find, replace) {
            String.prototype.replaceLast = function (what, replacement) {
                var pcs = this.split(what);
                var lastPc = pcs.pop();
                return pcs.join(what) + replacement + lastPc;
            };
        };
    }

Prototypes are super buggy anyway, I should rewrite that as a pure function.

By Anonymous, 2017-12-12 18:21:40