fiftyfifty
v1.3.0
Published
Is it true or is it false?
Downloads
3
Readme
fiftyfifty
Is it true or is it false?
Installation
npm install fiftyfifty@latest
How to use
This section describes how to use this package.
Default usage
import fiftyfifty from "fiftyfifty";
const x = fiftyfifty(); // x is `true` or `false`
Flip a coin
import { coinflip } from "fiftyfifty";
const coin = coinflip(); // coin is "heads" or "tails"
Advanced usage
Send trueValue and/or falseValue to fiftyfifty to set custom returns.
import fiftyfifty from "fiftyfifty";
const answer = fiftyfifty("right", "wrong");
console.log(answer); // "right" or "wrong"