title: Javascript remove last item in stack trace string
body: <p>I am creating a Javascript logger, in which, on error messages, I am also adding the stack trace like this:</p>
  
  <pre><code>function logMessage(logMessage) 
  {
    let stackTrace = new Error().stack;
    logMessage.stackTrace = stackTrace;
    ...
  }
  </code></pre>
  
  <p>This gives me the stack trace, but it also obviously adds the method of <code>logMessage</code> itself as the last item on the stack... </p>
  
  <p>How can I remove the last trace so I'll only see the trace up until the point that the <code>logMessage</code> was called, but without the <code>logMessage</code> itself?</p>