Question about solution 3

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:

That is the spread operator:

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.