Skip to content

Commit a504c19

Browse files
author
jjcapparell
committed
fixing factorial function
1 parent d6c280c commit a504c19

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lesson_07/conditionals/src/lesson7.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,8 @@ export function convertGpaToLetterGrade(gpa: number): string {
115115
* @return The factorial of n.
116116
*/
117117
export function computeFactorial(n: number): number {
118-
let fact = 0;
118+
let fact = 1;
119119
if (n>0){
120-
fact = 1;
121120
const numbers = Array.from({ length: n }, (_, index) => index + 1);
122121
for (const i of numbers) {
123122
fact *= i;

0 commit comments

Comments
 (0)