Tests if a value is between two values.
value to test
left comparison value
right comparison value
indicates whether the left comparison value is inclusive (default: 'closed')
indicates whether the right comparison value is inclusive (default: 'closed')
boolean indicating whether a value is between two values
var bool = isBetween( 3.14, 3.0, 4.0 );
// returns true
var bool = isBetween( 4.5, 3.0, 4.0 );
// returns false
var bool = isBetween( 3.14, 3.14, 4.0 );
// returns true
var bool = isBetween( 3.14, 3.14, 4.0, 'open', 'closed' );
// returns false
var bool = isBetween( 3.14, 3.0, 3.14 );
// returns true
var bool = isBetween( 3.14, 3.0, 3.14, 'closed', 'open' );
// returns false
Comparison type.