eval.in

Paste #200

JavaScript — Node 0.8.8, pasted 4 years ago

1
2
3
4
5
6
7
8
9
function fib(n) {
  if(n < 2) {
    return n;
  } else {
    return fib(n - 1) + fib(n - 2);
  }
}

console.log(fib(30));

Program Output

832040

OK (0.056 sec real, 0.056 sec wall, 42 MB, 42 syscalls)

Fork