@pho-nomenal/5-minute-github-demo
v21.5.1
Published
Functions for working with the Fibonacci sequence and things
Downloads
5
Readme
| Linux | Windows | MacOS| |-------|-------|-------| | | | |
fib-tools - Demo2021
https://www.npmjs.com/~pho-nomenal James
- run: npm publish --access public
Get the nth Number
const {getNumber} = require('@bbq-beets/fib-tools')
assert.strictEqual(getNumber(8), 21)
Get a List of Numbers
const {getList} = require('@bbq-beets/fib-tools')
assert.strictDeepEqual(getList(8), [0, 1, 1, 2, 3, 5, 8, 13, 21])
Get a Sequence of Numbers
const {getSequence} = require('@bbq-beets/fib-tools')
const seq = getSequence()
for (const n of seq) {
console.log(n) // The next Fibonacci number in the sequence
}