export function fibonacci(value) { // let previous = 0; let sum = 0; let next = 1; for (let i = 0; i < value; i++) { sum = previous + next; previous = next; next = sum; } return previous; }