質問編集履歴
1
コードの追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -11,6 +11,8 @@
|
|
11
11
|
|
12
12
|
|
13
13
|
```ここに言語を入力
|
14
|
+
|
15
|
+
//factorial3.html
|
14
16
|
|
15
17
|
<!DOCTYPE html>
|
16
18
|
|
@@ -57,3 +59,61 @@
|
|
57
59
|
</html>
|
58
60
|
|
59
61
|
```
|
62
|
+
|
63
|
+
|
64
|
+
|
65
|
+
```ここに言語を入力
|
66
|
+
|
67
|
+
|
68
|
+
|
69
|
+
//factorial2.html
|
70
|
+
|
71
|
+
<!DOCTYPE html>
|
72
|
+
|
73
|
+
|
74
|
+
|
75
|
+
<html lang='ja'>
|
76
|
+
|
77
|
+
<head>
|
78
|
+
|
79
|
+
<meta charset='UTF-8' />
|
80
|
+
|
81
|
+
<title>calleeプロパティによる再起呼び出し</title>
|
82
|
+
|
83
|
+
</head>
|
84
|
+
|
85
|
+
|
86
|
+
|
87
|
+
<body>
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
<h4 align=center>calleeプロパティによる再起呼び出し</h4>
|
92
|
+
|
93
|
+
<script>
|
94
|
+
|
95
|
+
function factorial(n) {
|
96
|
+
|
97
|
+
if (n != 0) {
|
98
|
+
|
99
|
+
return n * arguments.callee(n - 1);
|
100
|
+
|
101
|
+
}
|
102
|
+
|
103
|
+
return 1;
|
104
|
+
|
105
|
+
}
|
106
|
+
|
107
|
+
|
108
|
+
|
109
|
+
window.alert(factorial(5));
|
110
|
+
|
111
|
+
|
112
|
+
|
113
|
+
</script>
|
114
|
+
|
115
|
+
</body>
|
116
|
+
|
117
|
+
</html>
|
118
|
+
|
119
|
+
```
|