arr-iterator
v1.0.0
Published
An iterator for arrays.
Downloads
2
Readme
arr-iterator
An iterator for arrays.
Installation
npm install arr-iterator
Usage
var ArrIterator = require('arr-iterator')
var arr = ['foo', 'bar', 'baz']
var iter = new ArrIterator(arr)
iter.next() // => { done: false, value: 'foo' }
iter.next() // => { done: false, value: 'bar' }
iter.next() // => { done: false, value: 'baz' }
iter.next() // => { done: true, value: undefined }