You’re missing the key recursion logic in your code. You have to first test to make sure you’re not getting the same start and end number, and then call the function recursively to print the output.
function rangeOfNumbers(startNum, endNum) {
return startNum === endNum // check for equality
? [startNum] // equal, so just return the first number
// not equal, so return the function passed with the
// parameter options given
: [...rangeOfNumbers(startNum, endNum - 1), endNum ];
}