New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

array-carousel

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

array-carousel

Infinite and negative array index support `array[-1]` `array[array.length]` using ES2015 Proxy

latest
Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
3
-70%
Maintainers
1
Weekly downloads
 
Created
Source

Navigate through an array indefinitely. This allows you to use negative and out of range indexes on any given array.

Install

$ yarn add array-carousel # or npm i array-carousel

Usage

const carousel = require('array-carousel');

// Adds infinite (positive and negative) index support to any given array
const unicorn = carousel(['pony', 'cake', 'rainbow']);

console.log(unicorn[-1]) // 'rainbow'
console.log(unicorn[-9]) //'pony'
console.log(unicorn[4]) // 'cake'

unicorn[1] = null
console.log(unicorn[1]) // null

License

MIT

Keywords

array

FAQs

Package last updated on 01 Mar 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts