showing results for - "use recursion to create a range of numbers"
Simon
16 May 2017
1function rangeOfNumbers(startNum, endNum) {
2  if (endNum - startNum === 0) {
3    return [startNum];
4  } else {
5    var numbers = rangeOfNumbers(startNum, endNum - 1);
6    numbers.push(endNum);
7    return numbers;
8  }
9}