GoJS API
/ to search
    Preparing search index...

    Interface Iterable<T>

    This interface is implemented by the List, Set, and Map classes; it provides the iterator read-only property that returns an Iterator.

    Typical usage is:

    const it = anIterableCollection.iterator;
    while (it.next()) {
    const item = it.value;
    }

    Note that GoJS iteration is quite different than ECMAScript iteration. The GoJS collection classes were defined in GoJS before the ECMAScript collection classes were proposed.

    interface Iterable<T> {
        count: number;
        iterator: Iterator<T>;
        "[iterator]"(): IterableIterator<T>;
        first(): T | null;
    }

    Type Parameters

    • T

    Hierarchy (View Summary)

    Implemented by

    Index

    Methods

    Properties

    Methods

    • Returns IterableIterator<T>

    • Returns the first item in the list, or null if there is none.

      Returns T | null

      This returns null if there are no items in the list.

    Properties

    count: number

    This read-only property is the number of elements in the collection.

    iterator: Iterator<T>

    Gets an Iterator that can iterate over the items in the collection.

    Typical usage is:

     const it = anIterableCollection.iterator;
    while (it.next()) {
    const item = it.value;
    }