Skip to content

Latest commit

 

History

History
37 lines (23 loc) · 713 Bytes

README.md

File metadata and controls

37 lines (23 loc) · 713 Bytes

Code kata: Fibonacci

Description

The Fibonacci sequence is a series of numbers where the next number is calculates adding the two previous numbers. This sequence begins with two numbers: zero and one. The third number is calculated adding these two numbers (0 + 1). The fourth number is calculated adding the two numbers before it (1 + 1). And so on.

Having a position, the function returns the value that corresponds to that position in the Fibonacci sequence.

Example

// 0,1,1,2,3,5,8,13,21,34,55,89,144

position 0  // => 0
position 1  // => 1
position 2  // => 1
position 3  // => 2
position 10 // => 55

Run project

Install

npm install

Run test

npm test