Recursion
Recursion is the function calling itself.
Case Base case: The condition to stop the loop Recursive case: Keep self calling the function function countdown(i){ console.log(i); if (i <= 0) { // Base case return } return countdown(i-1); // Recursive case } Cost Recursion saving the info needs memory, if your recursion have to execute man times, you will need lots of memory.
However, it can be solved by Tail Recursion.