Javascript String toIntZero()

Description

Javascript String toIntZero()


String.prototype.toIntZero = function(){
  var val = parseInt(this);
  if(isNaN(val)){
    return 0;//from w w  w  .  ja  va2  s. c o m
  }else{
    return val
  }
};



PreviousNext

Related