Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Narshe1412/331262fff78d0c092654 to your computer and use it in GitHub Desktop.
Save Narshe1412/331262fff78d0c092654 to your computer and use it in GitHub Desktop.
http://www.freecodecamp.com/narshe1412 's solution for Bonfire: Factorialize a Number
// Bonfire: Factorialize a Number
// Author: @narshe1412
// 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 = 0; i < num; i++){
total *= i+1;
}
return total;
}
factorialize(5);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment