Fibonacci Number

Write a function to return the nth Fibonacci number

example:

fibonacci(0);
// 1
fibonacci(1);
// 1
fibonacci(2);
// 2
fibonacci(3);
// 3
fibonacci(4);
// 5
//
// 1, 1, 2, 3, 5, 8, 13, 21, ···


Share Comments