the-fibonacci

1.2.0 • Public • Published

Fibonacci Numbers!

Get the fionacci number to the nth place

Install:

npm install the-fibonacci

or

yarn add the-fibonacci

use:

const getFib = require('the-fibonacci').getFibonacci;
getFib(2)
//returns [2, [0,1,1]]

Takes an int and returns an array.

First index is the fibonacci number at int

Second index is an array of every fibonacci number up to int

theFibonacci(0) >> [0[0]]

theFibonacci(10) >> [55, [0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55]]

if an int is not supplied an empty array is returned.

theFibonacci() >> []

theFibonacci(null) >> []

theFibonacci(1.3) >> []

theFibonacci('12') >> []

Package Sidebar

Install

npm i the-fibonacci

Weekly Downloads

3

Version

1.2.0

License

ISC

Last publish

Collaborators

  • jaydaro