Javascript String to_i()

Description

Javascript String to_i()


String.prototype.to_i = function (){
  return parseInt(this);
}

Javascript String to_i()

String.prototype.to_i = function () {
  return parseInt(this.valueOf());
};

Javascript String to_i()

String.prototype.to_i = function() {
 // MUST add the radix as parsing dates gives leading 0s with will cause it to be octal.
 return parseInt(this,10);
}



PreviousNext

Related