Javascript String startsWith(suffix)

Description

Javascript String startsWith(suffix)

String.prototype.startsWith = function(suffix) {
    return this.indexOf(suffix, 0) !== -1;
};

Javascript String startsWith(suffix)

String.prototype.startsWith = function (suffix) {
    return !(this.indexOf(suffix) !== 0);
};



PreviousNext

Related