Skip to content

format

typescript
Stack.Push(item)

class: Stack

description

Pushes an element onto the stack.

parameter

param_nametypedescription
itemTThe value of the element.

reture

typedescription
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);