中文
Appearance
Stack.Peek()
Stack
获取但不移除堆栈顶部的元素。
T|undefined
let stack = new Stack<Number>(); stack.Push(1); stack.Push(2); stack.Push(3); //获取但不移除堆栈顶部的元素 let topItem = stack.Peek(); Debug.Log("栈顶元素:", topItem);