FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
JavaScript/Recursive/FibonacciNumberRecursive.js at patch-1 · chethangowda-web/JavaScript · GitHub
chethangowda-web
/
JavaScript
Public
forked from
TheAlgorithms/JavaScript
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
JavaScript
/
Recursive
/
FibonacciNumberRecursive.js
Copy path
More file actions
More file actions
Latest commit
History
History
History
16 lines (14 loc) · 388 Bytes
Breadcrumbs
JavaScript
/
Recursive
/
FibonacciNumberRecursive.js
Copy path
File metadata and controls
16 lines (14 loc) · 388 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/**
*
@function
Fibonacci
*
@description
Function to return the N-th Fibonacci number.
*
@param
{
Integer
} n - The input integer
*
@return
{
Integer
} - Return the N-th Fibonacci number
*
@see
[Fibonacci](https://en.wikipedia.org/wiki/Fibonacci_number)
*/
const
fibonacci
=
(
n
)
=>
{
if
(
n
<
2
)
{
return
n
}
return
fibonacci
(
n
-
2
)
+
fibonacci
(
n
-
1
)
}
export
{
fibonacci
}
Back
|
FazBrowse Home
|
New Git URL