RSX Code Reference
    Preparing search index...

    Class Queue<T>

    The Queue class implements the functionality of a queue - more specifically, a FIFO (first-in, first-out) queue.

    Type Parameters

    • T
    Index
    • Constructs a new queue, optionally with the specified elements.

      Type Parameters

      • T

      Parameters

      • ...elements: T[]

        Elements to add to the queue.

      Returns Queue<T>

    • get length(): number

      Gets the length of the queue.

      Returns number

    • Returns an iterator that allows iterating over all elements in the queue.

      Returns Generator<T, void, unknown>

    • Removes all entries from this instance.

      Returns void

    • Returns the front (first) element from the queue. If the queue is empty, undefined is returned and the queue is not modified.

      Returns T

      The front element or undefined if empty.

    • Removes the front (first) element from the queue and returns it. If the queue is empty, undefined is returned and the queue is not modified.

      Returns T

      The front element or undefined if empty.

    • Appends a new element to the end of the queue, and returns the new length of the queue.

      Parameters

      • element: T

      Returns number

    • Converts this instance to a string.

      Returns string