mirror of
https://github.moeyy.xyz/https://github.com/trekhleb/javascript-algorithms.git
synced 2024-12-26 23:21:18 +08:00
Add JSdocs for fibonacci.
This commit is contained in:
parent
d267d72524
commit
88bd8d7044
@ -1,4 +1,9 @@
|
||||
// Return a fibonacci sequence as an array
|
||||
/**
|
||||
* Return a fibonacci sequence as an array.
|
||||
*
|
||||
* @param n
|
||||
* @return {number[]}
|
||||
*/
|
||||
export default function fibonacci(n) {
|
||||
const fibSequence = [1];
|
||||
|
||||
|
@ -1,4 +1,9 @@
|
||||
// Calculate fibonacci number at specific position using Dynamic Programming approach.
|
||||
/**
|
||||
* Calculate fibonacci number at specific position using Dynamic Programming approach.
|
||||
*
|
||||
* @param n
|
||||
* @return {number}
|
||||
*/
|
||||
export default function fibonacciNth(n) {
|
||||
let currentValue = 1;
|
||||
let previousValue = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user