Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
function factorialize(num) {
result = 1;
for (var i = 1; i <= num; i++) {
result *= i;
}
return result;
}
factorialize(10);
@jamc92

This comment has been minimized.

Copy link
Owner Author

@jamc92 jamc92 commented Apr 3, 2016

  • factorialize(5) should return a number.
  • factorialize(5) should return 120.
  • factorialize(10) should return 3628800.
  • factorialize(20) should return 2432902008176640000.
  • factorialize(0) should return 1.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment