1.0.2 • Published 4 years ago

more-boolean-methods v1.0.2

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

More Boolean Methods!

Installation

require('more-boolean-methods')();
// Done!

Methods

MethodDescription
.random()Will give you a random boolean
.not()Will negate the boolean
.stringify()Will convert the boolean to a string
.numberify()Will convert the boolean to a number
.arrayify()Will convert the boolean to an array
.true()Will return true
.false()Will return false
.and(boolean)Will return the 'AND' value of the two booleans
.or(boolean)Will return the 'OR' value of the two booleans
.equals(boolean)Will return true if both booleans are equal
.xor(boolean)Will return the 'XOR' value of the two booleans

Examples

true.and(false) // expected output: false
false.or(true) // expected output: true
true.not() // expected output: false
true.false() // expected output: false
true.stringify() // expected output: 'true'

Infos

This module was kinda made as a joke, but you're free to use it anyways!