|
each
Overview of each
eacheach is a built in objx method that allows you to call a function for each item in an array. Actually, it works with any iterable type with slightly tuned behaviour for each one. Usageobjx( array ).each([modifier ,] function( item, index ) { ... });
The each method returns the same object it has just iterated over. Behaviour modifiersBehaviour modifiers change the way the each plugin works. true modifier - Go backwardsPassing true as the modifier will cause each to iterate backwards over the items. objx([1,2,3,4,5]).each(true, function(n){ alert("Countdown: " + n); });Range selector array modifierPassing an index range array will cause Objx to only iterate over that subset of items. | ||||||||
► Sign in to add a comment