Skip to content

Instantly share code, notes, and snippets.

@SerhiiLihus
Last active August 11, 2023 14:01
Show Gist options
  • Save SerhiiLihus/d537b5f51e2329cb939e to your computer and use it in GitHub Desktop.
Save SerhiiLihus/d537b5f51e2329cb939e to your computer and use it in GitHub Desktop.
Factorialize a Number
// Bonfire: Factorialize a Number
// Author: @serhiilihus
// Challenge: http://www.freecodecamp.com/challenges/bonfire-factorialize-a-number
// Learn to Code at Free Code Camp (www.freecodecamp.com)
function factorialize(num) {
return ( num === 1 || num === 0 ) ? 1 : num * factorialize(num - 1);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment