Members
length :number
Properties:
Name | Type | Description |
---|---|---|
Returns |
number
|
the number of items in the stack |
Type:
-
number
Methods
bottom(offsetopt) → {*}
Returns an item relative to the bottom of the stack
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
offset |
number
|
<optional> |
0 |
An index relative to the bottom of the stack. 0 for the bottom of the stack; 1 for the item above the bottom of the stack; 2 for the second item above the bottom of the stack; etc.. |
Returns:
- Type:
-
*
pop(toLengthopt) → {*|undefined}
Removes items from the top of the stack
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
toLength |
number
|
<optional> |
If undefined, remove the item at the top of the stack only. Otherwise, remove items from the top of the stack until its length is equal to the specified value. |
Returns:
- Type:
-
*
|undefined
The last item removed from the stack
push(item) → {number}
Adds an item to the top of the stack
Parameters:
Name | Type | Description |
---|---|---|
item |
*
|
Returns:
- Type:
-
number
The new length of the stack
top(offsetopt) → {*}
Returns an item relative to the top of the stack
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
offset |
number
|
<optional> |
0 |
An index relative to the top of the stack. 0 for the top of the stack; 1 for the item below the top of the stack; 2 for the second item below the top of the stack; etc.. |
Returns:
- Type:
-
*