Javascript String endsWith(input)

Description

Javascript String endsWith(input)

String.prototype.endsWith = function (input) {
    if (this.length < input.length)
        return false;
    return this.lastIndexOf(input) === this.length - input.length;
}



PreviousNext

Related