function boolean( x, value ) {
	var view;
	var n;
	var v;
	var i;

	if ( !isBoolean( value ) ) {
		return 0;
	}
	view = reinterpretBoolean( x, 0 );

	v = ( value ) ? 1 : 0;
	n = 0;
	for ( i = 0; i < view.length; i++ ) {
		if ( view[ i ] === v ) {
			n += 1;
		}
	}
	return n;
}
Counts the number of elements in a boolean array that are equal to a specified value.

@private
@param {Collection} x - input array
@param {*} value - search value
@returns {NonNegativeInteger} number of elements that are equal to a specified value

@example
var BooleanArray = require( '@stdlib/array/bool' );

var x = new BooleanArray( [ true, false, true, false, true ] );

var n = boolean( x, true );
// returns 3