Including a stack trace when logging - console.trace

suggest change
function foo() {
  console.trace('My log statement');
}

foo();

A browser console can display it like this. Node's format is different:

My log statement       VM696:1
  foo                  @ VM696:1
  (anonymous function) @ (program):1

Error.prototype.stack is a non-standard but widely available string. Engines format it differently. It is useful when you need to store or send the trace.

const e = new Error('foo');
console.log(e.stack);

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents