chance
Version:
Chance - Utility library to generate anything random
23 lines (16 loc) • 324 B
Markdown
# falsy
```js
// usages
chance.falsy()
chance.falsy({ pool: [ NaN, undefined ] })
```
Return a random falsy value (`false`, `null`, `undefined`, `0`, `NaN`, `''`).
```js
chance.falsy();
=> false
```
The default pool can be changed to better meet the needs:
```js
chance.falsy({ pool: [ NaN, undefined ] });
=> NaN
```