@webdeveric/ts-data-structures
    Preparing search index...

    Class Stack<Item>

    Last in first out

    Type Parameters

    • Item

    Implements

    Index

    Accessors

    • get size(): number

      Get the number of items in the stack.

      Returns number

    • get "[toStringTag]"(): string

      Identify itself in Object.toString()

      Returns string

    Methods

    • Determine if the stack is empty.

      Returns boolean

    • Get an iterator for the stack.

      Iterating the stack will drain it.

      Returns Generator<Item>

    • Get an iterator for the stack that returns a [position, item] tuple.

      Iterating the Stack will drain it.

      Returns Generator<[position: number, item: Item]>

    • Remove all items from the stack.

      Returns this

    • Add one or more items to the stack and return the new size.

      Parameters

      Returns number

    • Get the next item and remove it from the stack.

      Returns Item | undefined

    • Get the next item and leave it in the stack

      Returns Item | undefined