One of my functions is designed to take a parameter and print the last number in the Fibonacci Series. For example, if the parameter is 3, it would return 2 as the series progresses like 1, 1, 2.
function recursionFib(num){
if(num==0) return 0;
if(num==1) return 1;
return recursionFib(num-1)+recursionFib(num-2);
}
Now, I am interested in implementing closure within this function so that I can display the entire Fibonacci series instead of just the last number.