coinflip
v1.0.0
Published
randomly return true or false
Downloads
40
Readme
coinflip.js
Randomly return true
or false
.
To use in Node/Browserify/Webpack/CommonJS:
var coinflip = require('coinflip');
if (coinflip()) {
console.log('Heads!');
} else {
console.log('Tails!');
}
To use in the browser:
<script src="coinflip.js"></script>
<script>
if (coinflip()) {
console.log('Heads!');
} else {
console.log('Tails!');
}
</script>
Enjoy!