🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

roundround

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

roundround

A dead simple round-robin array iterator

0.2.0
latest
Source
npm
Version published
Weekly downloads
6.5K
-14.37%
Maintainers
1
Weekly downloads
 
Created
Source

RoundRound

A dead simple round-robin array iterator

build
status

Install

npm install roundround

Usage

var roundround = require('roundround');

// Initialize RoundRound with any Array (null or undefined are ok as well, so no
// guards necessary)
var rr = roundround([1,2,3]);

// Then call the result to get the next element in the array
rr(); // => 1
rr(); // => 2
rr(); // => 3

// When reaching the end of the internal array, the iterator starts over from
// the beginning
rr(); // => 1

// You can also specify an index from where RoundRound should start
var rr = roundround([1,2,3], 1);
rr(); // => 2

License

MIT

Keywords

array

FAQs

Package last updated on 30 Jan 2014

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