Booleans.isBetween()

Check that a number is within the specified range (inclusive).

Since this is an inclusive check, this returns `true` if the given number is equal to the minimum or maximum boundary specified.

Usage

Hover over inputs/exits for more info.

var Booleans = require('machinepack-booleans');


// Check that a number is within the specified range (inclusive).

Booleans.isBetween({

value: 3,

min: 1,

max: 4,

}).execSync();

Inputs

value required

The number to check.

3
min required

The lower bound to check the number against.

1
max required

The upper bound to check the number against.

4

Exits

error

An unexpected error occurred.

success

OK.

true