format
typescript
Stack.Push(item)class: Stack
description
Pushes an element onto the stack.
parameter
| param_name | type | description |
|---|---|---|
| item | T | The value of the element. |
reture
| type | description |
|---|---|
void |
code example
typescript
let stack = new Stack<Number>();
stack.Push(1);
stack.Push(2);
stack.Push(3);
// Pops the top element from the stack
let poppedItem = stack.Pop();
Debug.Log("Popped item: ", poppedItem);