Ad
Recursion
Mathematics
Code
Diff
  • const fibonacci = n => n <= 1 ? n : fibonacci(n - 1) + fibonacci(n - 2);
    • function fibonacci(n) {
    • return n <= 1 ? n : fibonacci(n - 1) + fibonacci(n - 2);
    • }
    • const fibonacci = n => n <= 1 ? n : fibonacci(n - 1) + fibonacci(n - 2);