Class: TypedStack

TypedStack(…types)

A stack class that only allows only specific types.

Constructor

new TypedStack(…types)

Parameters:
Name Type Attributes Description
types Class <repeatable>

The types to allow.

Source:

Extends

Members

items

The number of items in the stack.

Inherited From:
Source:

Methods

add(…items) → {undefined}

Add an item to the stack. Throws a TypeError if it is not an instance of any of the types.

Parameters:
Name Type Attributes Description
items * <repeatable>

The items to add.

Overrides:
Source:
Throws:

Invalid item provided.

Type
TypeError
Returns:
Type
undefined

remove() → {*}

Remove an item from the stack.

Inherited From:
Source:
Returns:

The item.

Type
*

Type Definitions

Type()

A constructor or class.

Source: