You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create a function`randomInteger(min, max)`that generates a random *integer*number from`min`to`max`including both`min`and`max`as possible values.
7
+
Buatlah sebuah fungsi`randomInteger(min, max)`yang menghasilkan angka *integer*acak dari`min`ke`max`termasuk keduanya`min`dan`max`sebagai nilai yang mungkin.
8
8
9
-
Any number from the interval `min..max`must appear with the same probability.
9
+
Angka apa pun dari interval `min..max`harus muncul dengan probabilitas yang sama.
10
10
11
11
12
-
Examples of its work:
12
+
Contoh kerjanya:
13
13
14
14
```js
15
15
alert( randomInteger(1, 5) ); // 1
16
16
alert( randomInteger(1, 5) ); // 3
17
17
alert( randomInteger(1, 5) ); // 5
18
18
```
19
19
20
-
You can use the solution of the [previous task](info:task/random-min-max)as the base.
20
+
Anda dapat menggunakan solusi dari [tugas sebelumnya](info:task/random-min-max)sebagai basis.
0 commit comments