I tried playing around with recursion in javascript. I wrote a function for the Fibonacci sequence. However, if only works if the argument is 0
fib = (x)=>{
if (x == 0 || x ==1) {
return 1
} else {
return fib(x-1) + fib(x+1)
}
}
It returns 1 for 1, but a number above 0 I get the error maximum call stack size exceeded