Share your code. Components are building blocks, you are the architect.

utils/nth
v1.1.0
1.1.0
1.0.0
MIT
PUBLIC
3
Build: fail
BuildFail
Build Status: fail
Returns the nth element of the given list or string

Please configure Bit as a scoped registry to install components with NPM.Learn more

npm config set '@bit:registry' https://node.bitsrc.io
Use utils/nth in your project
npm i @bit/bit.ramda.utils.nth
Copied

nth (offset:Number, list:*) : *

Returns the nth element of the given list or string. If n is negative the element at index length + n is returned.

Example

var list = ['foo', 'bar', 'baz', 'quux'];
     R.nth(1, list); //=> 'bar'
     R.nth(-1, list); //=> 'quux'
     R.nth(-99, list); //=> undefined

     R.nth(2, 'abc'); //=> 'c'
     R.nth(3, 'abc'); //=> ''

Arguments

offset: Number

list: *

Returns

*