回答編集履歴

1

ミスがあったため修正。

2017/09/01 04:36

投稿

kei344
kei344

スコア69407

test CHANGED
@@ -4,13 +4,13 @@
4
4
 
5
5
  ```JavaScript
6
6
 
7
- var a = 1 + limit_random( [ 4, 13, 18, 22, 34, 41 ] );
7
+ var a = limit_random( [ 4, 13, 18, 22, 34, 41 ] );
8
8
 
9
9
  function limit_random( arr ) {
10
10
 
11
11
  while( true ) {
12
12
 
13
- const i = Math.floor( Math.random() * 50 );
13
+ const i = 1 + Math.floor( Math.random() * 50 );
14
14
 
15
15
  if ( arr.indexOf( i ) === -1 ) {
16
16
 
@@ -34,4 +34,4 @@
34
34
 
35
35
  console.log(limit_random( [ 4, 13, 18, 22, 34, 41 ] ));
36
36
 
37
- ```**動くサンプル:**[https://jsfiddle.net/xkfandda/](https://jsfiddle.net/xkfandda/)
37
+ ```**動くサンプル:**[https://jsfiddle.net/xkfandda/1/](https://jsfiddle.net/xkfandda/1/)