title: Print current stack trace in JavaScript
body: <p>How do I print a stack trace from JavaScript?</p>
  
  <p>The answer <a href="https://stackoverflow.com/questions/591857/how-can-i-get-a-javascript-stack-trace-when-i-throw-an-exception">How can I get a Javascript stack trace when I throw an exception?</a> deals with throwing an exception, but I need to print stack traces to debug a memory leak.</p>
  
  <p>Basically I've got the same question as <a href="https://stackoverflow.com/questions/1069066/get-current-stack-trace-in-java">Get current stack trace in Java</a> but for JavaScript.</p>
  
  <p>And <a href="https://stackoverflow.com/questions/2923858/how-to-print-a-stack-trace-in-node-js">How to print a stack trace in Node.js?</a> is similar but it's Node.js and I want to know for JavaScript, more generally speaking, if it's different.</p>