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

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.

  Returns:

  Type | Description
  --- | ---
  InsightArrayIterator | the iterator to allow chaining commands

  ##### Example

      var key = [4]; // 4th item
      var arr = scenario.getArray('INTEGER_ARRAY');
      array.moveBefore(key);
      array.next(); // fourth item returned

  Back to Top
moveBeforeFirst ( ) → {InsightArrayIterator}

  Resets the iterator back to the start.

  Returns:

  Type | Description
  --- | ---
  InsightArrayIterator | the iterator to allow chaining commands

  ##### Example

      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
next ( ) → {Object.<{key: Array.<(string|number|boolean)>, value: (string|number|boolean)}>|undefined}

  Retrieves the next element in the Insight Array.

  Returns:

  Type | Description
  --- | ---
  Object.<{key: Array.<(string|number|boolean)>, value: (string|number|boolean)}> | undefined | Undefined if end of data

  ##### Example

      var arr = scenario.getArray('INTEGER_ARRAY');
      var keyValueObject;
      while (keyValueObject = array.next()) {
           // do something with value
      }

  Back to Top

Parent Topic Classes

© 2001-2026 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.