Implement rangeRight([start=0], end, [step=1]) — it produces the same set of numbers as Lodash's _.range, but the array comes back in descending order. The mental shortcut: build the ascending range [start, end) stepped by step, then reverse it. The signature mirrors range exactly, including the one-argument shorthand where the lone value is the end and start defaults to 0.
// start: number — inclusive lower bound. Defaults to 0.
// With ONE argument, that argument is `end` and start is 0.
// end: number — exclusive upper bound. The range is half-open: [start, end).
// step: number — the increment between values. Defaults to 1, or to -1 when
// end < start (a descending source range).
// returns: number[] — the [start, end) values, stepped by step, REVERSED.
function rangeRight(start, end, step): number[];
rangeRight(4); // → [3, 2, 1, 0] (one arg: end=4, start=0)
rangeRight(1, 5); // → [4, 3, 2, 1] (start..end form)
rangeRight(0, 20, 5); // → [15, 10, 5, 0] (explicit step)
rangeRight(0, -4, -1); // → [-3, -2, -1, 0] (negative step descends, then reverses)
rangeRight(0); // → [] (empty range)
rangeRight(4) means start = 0, end = 4. Two arguments are start, end. Three add an explicit step.end is never included: rangeRight(1, 5) covers 1, 2, 3, 4 and stops before 5.end < start and no step is given, the step is -1 so the source range descends. Match this before reversing.0 as []. Lodash emits a run of start for a zero step; here, return an empty array instead and the tests check that choice.range reversed. Whatever range(start, end, step) would produce, rangeRight returns the same values in the opposite order.