circular-at
Access array items at any positive or negative index. If the index is out of bounds, it will be wrapped around the length of the array.
For example:
const array = 'a' 'b' 'c' === 'a' === 'b' === 'c' === 'a' === 'b' === 'c' // ... and so on
This goes for negative indices as well:
=== 'c' === 'b' === 'a' === 'c' === 'b' // ... and so on
If the given value is not an array, it behaves like value[index]
Install
npm install circular-at
License
MIT