mirror of
https://github.com/leporello-js/leporello-js
synced 2026-01-13 21:14:28 -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)
|
||||||
@@ -11,6 +11,10 @@ export const examples = [
|
|||||||
path: 'github_api',
|
path: 'github_api',
|
||||||
entrypoint: 'github_api/index.js',
|
entrypoint: 'github_api/index.js',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: 'fibonacci',
|
||||||
|
entrypoint: 'fibonacci/index.js',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: 'todos-preact',
|
path: 'todos-preact',
|
||||||
entrypoint: 'todos-preact/index.js',
|
entrypoint: 'todos-preact/index.js',
|
||||||
|
|||||||
Reference in New Issue
Block a user