SB-6.1-PRE
This commit is contained in:
1 parent
690169a409
commit
358a25f522
3760 files changed
+300059
-36
No files matched your search
+24
@@ -0,0 +1,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`.
|
||||
|
||||
Reference in new issue
Block a user