mirror of
https://github.com/leporello-js/leporello-js
synced 2026-01-13 13:04:30 -08:00
12 lines
139 B
JavaScript
12 lines
139 B
JavaScript
// Fibonacci numbers
|
|
|
|
function fib(n) {
|
|
if (n == 0 || n == 1) {
|
|
return n
|
|
} else {
|
|
return fib(n - 1) + fib(n - 2)
|
|
}
|
|
}
|
|
|
|
fib(6)
|