Skip to content

yorchv/oruga

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

Oruga.js

Walk thru your array by steps. You can move forwards and backwards.

Use

Insert the oruga.js script into your stack.

  1. Create a new Oruga
  var absolem = new Oruga([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);
  1. ** Get the current state **
  absolem.get(); // [1, 2, 3]
  1. ** Get the next step **
  absolem.next(); // [2, 3, 4]
  1. ** Get the previous step **
 absolem.prev(); // [1, 2, 3]

Options

  • ** Size ** (Default: 3)
var heimlich = new Oruga([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], { size: 5 });
heimlinch.get(); // [1, 2, 3, 4, 5]
heimlinch.next(); // [2, 3, 4, 5, 6]
  • ** Step ** (Default: 1)
var heimlich = new Oruga([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], { step: 2 });
heimlinch.get(); // [1, 2, 3]
heimlinch.next(); // [3, 4, 5]
  • ** Origin ** (Default: 0)
var heimlich = new Oruga([1, 2, 3, 4, 5, 6, 7, 8, 9, 10], { origin: 3 });
heimlinch.get(); // [4, 5, 6]
heimlinch.next(); // [5, 6, 7]

Created by Jorge Vivas - 2014 License MIT: You are free to use and modify this code for any use, on the condition that this copyright notice remains.

About

Walk thru your array by steps.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published