Essential JavaScript

In Range Kata

Determine if a number is between a given minimum (min) and maximum (max) number.

The range is inclusive, so if number is equal to either min or max, it is considered to be within the range.

All arguments - number, min, and max - can be positive or negative.

You can expect min to always be less than max.

Return true if the number is in range and false otherwise.


isNumberInRange(1, 1, 10); // true
isNumberInRange(1, 2, 3); // false
isNumberInRange(1, -2, 1); // true

Code Editor