print stack trace javascript code example
Example 1: javascript dump strack trace
console.trace();
Example 2: javascript get stack trace
try {
throw "Could not parse that text!";
} catch(e) {
console.log(e.stack); //log the stack trace to console
}
Example 3: js log stack trace
console.log(new Error().stack);