Recursion: A simple base case and a recursive step

About recursion:
In programming it is called recursion when a function calls itself, executing the code it contains over and over until the base case returns a value without making any subsequent recursive calls.
Recursive functions can be very economical in lines of code, solving problems easily but this can be at the cost of consuming more resources of our ram memory, it must be analyzed if a recursive algorithm would have a lower cost than a non-recursive algorithm to implement it within our code.
Some classic examples to demonstrate how a recursive function works:
The factorial of a number (JavaScript):

Calculate the Fibonacci order (Python):

Another example:
Find the value of the number X raised to the power of Y (C):

In this example we need to find the value of the number “x” raised to the power of “y” and we will use a recursive function. A stack is a data structure that stores information about the active subroutines of a computer program, each box from the image represents a stack frame. When a function is called recursively, a new stack frame is created for each call, leaving the previous stack frames intact.
In the examples, the recursive function is called four times, so there are four stack frames pushed on the stack; each frame stores one instance of the variable “y” and each instance holds a different value, once “y” has reached the value of zero each stack frame is removed from the stack and a new value is returned.
