InsightArrayIterator
Iterator class for the InsightArray. Instantiated by getIterator() on the InsightArray object.
Method summary
name | description |
---|---|
moveBefore | Set the cursor position. |
moveBeforeFirst | Resets the iterator back to the start. |
next | Retrieves the next element in the Insight Array. |
Methods
- moveBefore ( ) → {InsightArrayIterator}
-
Position the cursor so that the next element returned will be the one specified by the passed in key. If the key does not exist then there is no change to the cursor position.
detailsReturns:returns tableType Description typeInsightArrayIteratorthe iterator to allow chaining commands Example
examples
Back to Topvar key = [4]; // 4th item var arr = scenario.getArray('INTEGER_ARRAY'); array.moveBefore(key); array.next(); // fourth item returned
- moveBeforeFirst ( ) → {InsightArrayIterator}
-
Resets the iterator back to the start.
detailsReturns:returns tableType Description typeInsightArrayIteratorthe iterator to allow chaining commands Example
examples
Back to Topvar arr = scenario.getArray('INTEGER_ARRAY'); array.next(); // first item array.next(); // second item array.next(); // third item array.moveBeforeFirst(); // reset the cursor array.next(); // first item array.next(); // second item
- next ( ) → {Object.<{key: Array.<(string|number|boolean)>, value: (string|number|boolean)}>|undefined}
-
Retrieves the next element in the Insight Array.
detailsReturns:returns tableType Description typeObject.<{key: Array.<(string|number|boolean)>, value: (string|number|boolean)}> | undefinedUndefined if end of data Example
examples
Back to Topvar arr = scenario.getArray('INTEGER_ARRAY'); var keyValueObject; while (keyValueObject = array.next()) { // do something with value }
method
method
method