Javascript String newStartsWith(s)

Description

Javascript String newStartsWith(s)


String.prototype.newStartsWith = function (s) {
  return this.indexOf(s) == 0;
}

var str = 'aabbcc';
console.log(str.newStartsWith('aa'));



PreviousNext

Related