Skip to content

Commit 8096f6d

Browse files
Add JSDoc comments for factorial function which is example of the factorial code output.
Added documentation for the factorial function.
1 parent 08d8c6b commit 8096f6d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Maths/Factorial.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@
1111
https://en.wikipedia.org/wiki/factorial
1212
*/
1313

14+
/**
15+
* Returns the factorial of a number n.
16+
* Factorial is the product of all positive integers up to n.
17+
* Example: factorial(5) = 5 × 4 × 3 × 2 × 1 = 120
18+
*/
19+
1420
'use strict'
1521

1622
const calcRange = (num) => {

0 commit comments

Comments
 (0)