Socket
Socket
Sign inDemoInstall

roundround

Package Overview
Dependencies
0
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

roundround

A dead simple round-robin array iterator


Version published
Maintainers
1
Install size
4.51 kB
Created

Readme

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

FAQs

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc