Javascript String startWith(text)

Description

Javascript String startWith(text)


String.prototype.startWith = function (text) {
    return this.indexOf(text) == 0;
};

var msg = "Hello world!";
console.log(msg.startWith("Hello"));



PreviousNext

Related