I don't understand line 18? If the input is 100 how does program print out the number 1 first and end with the number 100 in the array? Any help would be appreciated.
function fizzBuzz(n){
//create empty array called results
//create base case for when n === 1
//recurse and push value to array
var results = [];
if(n === 1){
return [1];
} else {
if(n % 3 === 0 && n % 5 === 0){
results.push('FizzBuzz')
} else if (n % 3 === 0){
results.push('Fizz')
} else if (n % 5 === 0){
results.push('Buzz')
} else {
results.push(n);
}
return fizzBuzz(n - 1).concat(results); // ???
}
}
console.log(fizzBuzz(100));