Start sharing components as a team!Share components as a team!Join Bit to build your applications faster.Get Started Free

fib

v0.0.1arrow_drop_down
v0.0.1
STATUS
Passing
DOWNLOADS
2
VISIBILITY
Public
PUBLISHED
3 years ago
SIZE
482 B
gets the nth integer in the fibonacci sequence
1 contributor
Install fib as a package?
Copied
npm i @bit/gideonshils.sample.global.fib
Set Bit as a scoped registryLearn more
npm config set '@bit:registry' https://node.bit.dev
Component Example
React
React
Vue
Angular
React Native
Add dependency... help_outline
Just
import
any of the 1 million components
and packages in Bit or NPM to the example.
import Button from '@bit/grommet.grommet.button';
import Lodash from 'lodash';
toggle layout
fib(0) // => 0
fib(10) // => 55
modifieddraft
chevron_left
chevron_right
global/fib (
val:number
) : number

gets the nth integer in the fibonacci sequence

Example
fib(0) // => 0
fib(10) // => 55
Argument
val: number

position (n)

Returns
number

integer at the given position in the sequence

Test Summary

#fib() should return 0 if 0 is passed

Pass

#fib() should return 1 if 1 is passed

Pass

#fib() should return 1 if 2 is passed

Pass

#fib() should return 2 if 3 is passed

Pass