回答編集履歴
1
実行されないのは変数定義してるだけだった、今度こそ大丈夫
answer
CHANGED
@@ -101,7 +101,7 @@
|
|
101
101
|
}
|
102
102
|
|
103
103
|
// テストコードもリファクタリング
|
104
|
-
|
104
|
+
[
|
105
105
|
{it: 1},
|
106
106
|
{it: 2},
|
107
107
|
{it: 3, expected: 'Fizz'},
|
@@ -116,11 +116,9 @@
|
|
116
116
|
{it: 12, expected: 'Fizz'},
|
117
117
|
{it: 13},
|
118
118
|
{it: 14},
|
119
|
-
{it: 15, expected: 'FizzBuzz'}
|
119
|
+
{it: 15, expected: 'FizzBuzz'}
|
120
120
|
].forEach(({it, expected}) => {
|
121
|
-
if (!expected) {
|
122
|
-
|
121
|
+
if (!expected) expected = '' + it;
|
123
|
-
}
|
124
122
|
console.assert(fizzbuzz(it) === expected, `${it} is "${expected}"`);
|
125
123
|
});
|
126
124
|
```
|