Last active
August 11, 2023 14:01
-
-
Save SerhiiLihus/d537b5f51e2329cb939e to your computer and use it in GitHub Desktop.
Factorialize a Number
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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