Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

factorial program in javascript

function fact(N){
  if(N <= 1){
  	return "1";
  }
  else
  {
    return N * fact(N-1);  
  }
}

fact(5);
Source by 1loc.dev #
 
PREVIOUS NEXT
Tagged: #factorial #program #javascript
ADD COMMENT
Topic
Name
6+4 =