Javascript String endsWith(t, i)

Description

Javascript String endsWith(t, i)


String.prototype.endsWith = function(t, i) {
  if (i == false) {
    return (t == this.substring(this.length - t.length));
  } else {/*w  w w.j  av  a  2 s. c  o m*/
    return (t.toLowerCase() == this.substring(this.length - t.length).toLowerCase());
  }
};



PreviousNext

Related