Constructor
new Chain(items)
Create a new Chain.
Parameters:
Name | Type | Description |
---|---|---|
items | Array.<any> | (Optional) Items to add |
- Source
Methods
addBack(item)
Add an item to the end of the Chain.
Parameters:
Name | Type | Description |
---|---|---|
item | any | Item to add |
- Source
addFront(item)
Add an item to the beginning of the Chain.
Parameters:
Name | Type | Description |
---|---|---|
item | any | Item to add |
- Source
clear()
Remove all items from the Chain.
- Source
popBack()
Remove and return the last item in the Chain.
- Source
Returns:
Removed item
popFront()
Remove and return the first item in the Chain.
- Source
Returns:
Removed item
removeBack()
Remove the last item in the Chain.
- Source
removeFront()
Remove the first item in the Chain.
- Source