Quotes help make search much faster. Example: "Practice Makes Perfect"

Friday, May 12, 2017

FreeCodeCamp Factorialize A Number Sample Solution



function factorialize(num) {
  var prod = num;
  if(num === 0){
    return 1;
  }
  for(var i=num-1; i>0; i--){
    prod *= i;
  }
  return prod;
}

factorialize(5);

No comments:

Post a Comment


This is an example of scrolling text using Javascript.

Popular Posts