Skip to content

format

typescript
Stack.Pop()

class: Stack

description

Pops an element from the stack.

parameter

param_nametypedescription

reture

typedescription
T|undefinedThe popped element value.

code example

typescript
let stack = new Stack<Number>();
stack.Push(1);
stack.Push(2);
stack.Push(3);
// Pop the top element from the stack
let poppedItem = stack.Pop();
Debug.Log("Popped element:", poppedItem);