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