Test if a value is a boolean.
var isBoolean = require( '@stdlib/utils/is-boolean' );
Tests if a value
is a boolean
.
var bool = isBoolean( false );
// returns true
bool = isBoolean( true );
// returns true
bool = isBoolean( new Boolean( false ) );
// returns true
bool = isBoolean( new Boolean( true ) );
// returns true
Tests if a value
is a primitive boolean
.
var bool = isBoolean.isPrimitive( true );
// returns true
bool = isBoolean.isPrimitive( false );
// returns true
bool = isBoolean.isPrimitive( new Boolean( true ) );
// returns false
Tests if a value
is a Boolean
object.
var bool = isBoolean.isObject( true );
// returns false
bool = isBoolean.isObject( new Boolean( false ) );
// returns true
var isBoolean = require( '@stdlib/utils/is-boolean' );
var bool = isBoolean( false );
// returns true
bool = isBoolean( new Boolean( false ) );
// returns true
bool = isBoolean( 'true' );
// returns false
bool = isBoolean( null );
// returns false