• 0

Get Stack Trace in Node JS or Web browsers or in Javascript in general

There are two ways to get the stack trace.

console.log(new Error().stack);
console.trace();