.pop() 在浏览器控制台中不起作用,为什么?

.pop() not working in browser cosole, why?

当我在浏览器控制台中尝试 console.log(this.pop()) 时,它显示了这个错误

Uncaught TypeError: this.pop is not a function at :1:6

有什么方法可以让它工作吗?

希望你能帮助我

pop() 是在 Array.prototype 中找到的方法,globalThis 是一个对象

pop method can be called or applied to objects resembling arrays. Objects which do not contain a length property reflecting the last in a series of consecutive, zero-based numerical properties may not behave in any meaningful manner.