Skip to content

Instantly share code, notes, and snippets.

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