blob: e5b6a886d9d2706d0af20e727aa6aa94f0c9d4c7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
# bool
```js
// usages
chance.bool()
chance.bool({ likelihood: 30 })
```
Return a random boolean value (`true` or `false`).
```js
chance.bool();
=> true
```
The default likelihood of success (returning `true`) is 50%.
Can optionally specify the likelihood in percent:
```js
chance.bool({likelihood: 30});
=> false
```
In this case only a 30% likelihood of `true`, and a 70% likelihood of `false`.
|