Implement a function inRange(number, start, end) that checks if a number falls between two numbers.
The function should:
true if number is greater than or equal to start and less than end.end is not provided, use 0 as the start and the provided value as end.start and end if start > end.Examples
inRange(3, 2, 4); // true inRange(4, 8); // true, between 0 and 8 inRange(4, 2); // false, between 0 and 2 inRange(2, 2, 4); // true inRange(5, 2, 4); // false
JavaScript Function
No test results yet
Click "Run" to execute tests