/*
Recursion is when a function calls itself until someone stops it.
If no one stops it then it'll recurse (call itself) forever.
*/
// program to count down numbers to 1
function countDown(number) {
// display the number
console.log(number);
// decrease the number value
const newNumber = number - 1;
// base case
if (newNumber > 0) {
countDown(newNumber);
}
}
countDown(4);
// Out put:
4
3
2
1