回答編集履歴
1
betu
test
CHANGED
@@ -19,3 +19,13 @@
|
|
19
19
|
console.log(factorial(10000n));
|
20
20
|
|
21
21
|
```
|
22
|
+
|
23
|
+
# 別解
|
24
|
+
|
25
|
+
```javascript
|
26
|
+
|
27
|
+
const factorial=x=>Array(x).fill(null).map((_,x)=>BigInt(x+1)).reduce((x,y)=>x*y);
|
28
|
+
|
29
|
+
console.log(factorial(10000));
|
30
|
+
|
31
|
+
```
|