basic javascript 3a use recursion to create a range of numbers

Solutions on MaxInterview for basic javascript 3a use recursion to create a range of numbers by the best coders in the world

showing results for - "basic javascript 3a use recursion to create a range of numbers"
Viktoria
24 Jun 2016
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}
Leah
01 Jun 2017
1gfg h nhjytnrntnjymi, h fh dh g ffg d