Initializing help system before first use

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

method
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.

details
Returns:
returns table
Type Description
type
InsightArrayIterator
the iterator to allow chaining commands
Example
examples
var key = [4]; // 4th item
var arr = scenario.getArray('INTEGER_ARRAY');
array.moveBefore(key);
array.next(); // fourth item returned
Back to Top
method
moveBeforeFirst ( ) → {InsightArrayIterator}

Resets the iterator back to the start.

details
Returns:
returns table
Type Description
type
InsightArrayIterator
the iterator to allow chaining commands
Example
examples
var 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
Back to Top
method
next ( ) → {Object.<{key: Array.<(string|number|boolean)>, value: (string|number|boolean)}>|undefined}

Retrieves the next element in the Insight Array.

details
Returns:
returns table
Type Description
type
Object.<{key: Array.<(string|number|boolean)>, value: (string|number|boolean)}> | undefined
Undefined if end of data
Example
examples
var arr = scenario.getArray('INTEGER_ARRAY');
var keyValueObject;
while (keyValueObject = array.next()) {
     // do something with value
}
Back to Top

© 2001-2019 Fair Isaac Corporation. All rights reserved. This documentation is the property of Fair Isaac Corporation (“FICO”). Receipt or possession of this documentation does not convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except solely for internal evaluation purposes to determine whether to purchase a license to the software described in this documentation, or as otherwise set forth in a written software license agreement between you and FICO (or a FICO affiliate). Use of this documentation and the software described in it must conform strictly to the foregoing permitted uses, and no other use is permitted.