Javascript Number isNatural()

Description

Javascript Number isNatural()

Number.prototype.isNatural = function(){
  var ans = false;
  if(this.isInteger && this>=0){
    ans = true;//from ww  w .j  a  va2s . com
  }
  return ans;
}



PreviousNext

Related