add fibonacci example

This commit is contained in:
Dmitry Vasilev
2023-07-17 05:03:21 +03:00
parent 43f1de5f43
commit 315880176a
2 changed files with 13 additions and 0 deletions

View 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)