From 155cb843fa29817fab9ea5627851c4cd0abd9c0c Mon Sep 17 00:00:00 2001 From: Clebson <43012757+clebsonf@users.noreply.github.com> Date: Sat, 31 Oct 2020 02:54:50 -0300 Subject: [PATCH] Create fib.js --- 1_Fib/fib.js | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 1_Fib/fib.js diff --git a/1_Fib/fib.js b/1_Fib/fib.js new file mode 100644 index 0000000..f60abc4 --- /dev/null +++ b/1_Fib/fib.js @@ -0,0 +1,5 @@ +function fibonacci(num) { + if (num <= 1) return 1; + + return fibonacci(num - 1) + fibonacci(num - 2); +}