回答編集履歴
1
map.lengthをmap.sizeへ変更
test
CHANGED
@@ -10,7 +10,7 @@
|
|
10
10
|
|
11
11
|
//keyは1~4となっているため1を足す。
|
12
12
|
|
13
|
-
const randIndex =1+ Math.floor(Math.random() * Math.floor(words.
|
13
|
+
const randIndex =1+ Math.floor(Math.random() * Math.floor(words.size));
|
14
14
|
|
15
15
|
|
16
16
|
|
@@ -19,3 +19,5 @@
|
|
19
19
|
const word = words.get(""+randIndex);
|
20
20
|
|
21
21
|
```
|
22
|
+
|
23
|
+
※コメントを受けて修正しました。
|