Compute optimized utility to generate Fibonacci sequence(s). The library is implemented as a singleton and will not compute values that have already been computed.
- Import the utility into your codebase
import Fibonacci from 'fibonacci-singleton'
const Fibonacci = require('fibonacci-singleton')
- Generate Sequences
Fibonacci.getSequence(7)
[0, 1, 1, 2, 3, 5, 8]
Fibonacci.getSequence(2)
[0, 1]