UNPKG

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