Skip to content

Commit a6a68b2

Browse files
author
highflyer910
committed
Factorialize number
1 parent 9ff01a3 commit a6a68b2

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

factorialize.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
function factorialize(num) {
2+
var factorial = 1;
3+
for (var n = 2; n <= num; n++) {
4+
factorial = factorial * n;
5+
}
6+
7+
return factorial;
8+
}

0 commit comments

Comments
 (0)