Any Error
object has a stack
member that traps the point at which it was constructed.
(任何Error
对象都有一个stack
成员,用于捕获构造它的点。)
var stack = new Error().stack
console.log( stack )
or more simply:
(或更简单地说:)
console.trace("Here I am!")
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…