Implement a function rangeRight(start, end, step) that returns an array of numbers in descending order.
The function should:
end - 1 down to start.step to 1 if not provided.start > end by returning an empty array.Examples
rangeRight(0, 5); // [4, 3, 2, 1, 0] rangeRight(2, 10, 2); // [8, 6, 4, 2] rangeRight(5, 2, -1); // [] (invalid because start > end in descending logic) rangeRight(3, 3); // []
JavaScript Function
No test results yet
Click "Run" to execute tests