Latest
function inRange
import { inRange } from "https://dotland.deno.dev/x/lodash_es@v0.0.2/src/number.js";

Checks if n is between start and up to, but not including, end. If end is not specified, it's set to start with start then set to 0. If start is greater than end the params are swapped to support negative ranges.

Examples

_.inRange(3, 2, 4); // => true

_.inRange(4, 8); // => true

_.inRange(4, 2); // => false

_.inRange(2, 2); // => false

_.inRange(1.2, 2); // => true

_.inRange(5.2, 4); // => false

_.inRange(-3, -2, -6); // => true

Parameters

number

The number to check.

start

The end of the range.

end