Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

return inner range recursive

function count(n) {
  if (n === 1) {
    return [1];
  } else {
    var numbers = count(n - 1); 
    numbers.push(n);
    return numbers;
  }
}
Source by forum.freecodecamp.org #
 
PREVIOUS NEXT
Tagged: #return #range #recursive
ADD COMMENT
Topic
Name
8+3 =