mirror of
https://github.com/leporello-js/leporello-js
synced 2026-01-13 13:04:30 -08:00
add fibonacci example
This commit is contained in:
9
docs/examples/fibonacci/index.js
Normal file
9
docs/examples/fibonacci/index.js
Normal file
@@ -0,0 +1,9 @@
|
||||
function fib(n) {
|
||||
if(n == 0 || n == 1) {
|
||||
return n
|
||||
} else {
|
||||
return fib(n - 1) + fib(n - 2)
|
||||
}
|
||||
}
|
||||
|
||||
fib(6)
|
||||
Reference in New Issue
Block a user