function fib(num) { if(num <= 2) return 1; return fib(num-1)+fib(num-2); } document.write(fib(6)); //8
The output of this code is 8 but why?