1.1.1 • Published 4 years ago

arraytraverser v1.1.1

Weekly downloads
8
License
ISC
Repository
github
Last release
4 years ago

Simple usage pre version 1.1.0

import

require('arraytraverser')

Instantiate iterator

const iterator = [1,2,3,4].traverser()

Traverse your array

iterator.next() // 1 iterator.next() // 2 iterator.prev() // 2 iterator.prev() // 1

Go to wikipage for full example on how to improve the functionality when traversing.

Version 1.1.0

Features a new Iterator that does those extra steppes for you when changing direction

In this version both iterators will be available from the import

import

require('arraytraverser/smoother')

Instantiate iterator

const iterator = [1,2,3,4].smoothTraverser()

Traverse your array

iterator.next() // 1 iterator.next() // 2 iterator.prev() // 1 iterator.prev() // undefined iterator.next() // 2