Skip to content

Commit 6994cf8

Browse files
committed
added logic
1 parent 6c03226 commit 6994cf8

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

app/mathUtils.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
export function square(x) {
2+
return x * x;
3+
}
4+
5+
export function cube(x) {
6+
return x * x * x;
7+
}
8+
9+
export function factorial(n) {
10+
if (n === 0) return 1;
11+
return n * factorial(n - 1);
12+
}
13+

0 commit comments

Comments
 (0)