ixfx
    Preparing search index...

    Creates a stack. Mutable. Use StackImmutable for an immutable alternative.

    // Create
    const s = new StackMutable();
    // Add one or more items
    s.push(1, 2, 3, 4);

    // See what's on top
    s.peek; // 4

    // Remove the top-most, and return it
    s.pop(); // 4

    // Now there's a new top-most element
    s.peek; // 3

    Type Parameters

    • V

    Implements

    Index

    Accessors

    Constructors

    Methods

    Properties

    Accessors

    • get isFull(): boolean

      Returns true if the stack is full, false otherwise. Note that a stack is only full if a maxSize option was provided at construction time.

      Returns boolean

    Constructors

    Methods

    Properties

    data: readonly V[]
    opts: StackOpts