Solution 3:
function rangeOfNumbers(startNum, endNum) {
return startNum === endNum
? [startNum]
: [...rangeOfNumbers(startNum, endNum - 1), endNum ];
}
This hasn’t been covered yet and was wondering what the three dots mean in the false part of the conditional operator?
Challenge: Use Recursion to Create a Range of Numbers
Link to the challenge: