Skip to content

Instantly share code, notes, and snippets.

@mtroiani
Created December 11, 2015 18:42
Show Gist options
  • Save mtroiani/893bb2b42a32e9f36069 to your computer and use it in GitHub Desktop.
Save mtroiani/893bb2b42a32e9f36069 to your computer and use it in GitHub Desktop.
http://www.freecodecamp.com/mtroiani 's solution for Bonfire: Factorialize a Number
// Bonfire: Factorialize a Number
// Author: @mtroiani
// Challenge: http://www.freecodecamp.com/challenges/bonfire-factorialize-a-number
// Learn to Code at Free Code Camp (www.freecodecamp.com)
function factorialize(num) {
var i = 1
var product = 1
while (i <= num) {
product = product * i;
i ++;
}
return product;
}
factorialize(5);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment