From 88bd8d704463ec2161837a74a4cd7af67ad5382f Mon Sep 17 00:00:00 2001 From: Oleksii Trekhleb Date: Sat, 2 Jun 2018 09:32:50 +0300 Subject: [PATCH] Add JSdocs for fibonacci. --- src/algorithms/math/fibonacci/fibonacci.js | 7 ++++++- src/algorithms/math/fibonacci/fibonacciNth.js | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/algorithms/math/fibonacci/fibonacci.js b/src/algorithms/math/fibonacci/fibonacci.js index f623e9ae..3230dfdd 100644 --- a/src/algorithms/math/fibonacci/fibonacci.js +++ b/src/algorithms/math/fibonacci/fibonacci.js @@ -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]; diff --git a/src/algorithms/math/fibonacci/fibonacciNth.js b/src/algorithms/math/fibonacci/fibonacciNth.js index c5d33928..76bbbe87 100644 --- a/src/algorithms/math/fibonacci/fibonacciNth.js +++ b/src/algorithms/math/fibonacci/fibonacciNth.js @@ -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;