Place this line where you want to print the stack trace:
console.log(new Error().stack);
Note: tested by me on Chrome 24 and Firefox 18
May be worth taking a look at this tool as well.
More Related Contents:
- What’s a good way to extend Error in JavaScript?
- How do I create a custom Error in JavaScript?
- JavaScript Exception Handling
- Is it possible to catch exceptions thrown in a JavaScript async callback?
- alias to chrome console.log
- In Javascript, is it expensive to use try-catch blocks even if an exception is never thrown?
- Custom exception type
- throw Error(‘msg’) vs throw new Error(‘msg’)
- Javascript Asynchronous Exception Handling with node.js
- How to catch net::ERR_CONNECTION_REFUSED
- Why doesn’t the try catch block catch the promise exception?
- Set cookie and get cookie with JavaScript [duplicate]
- How do you get a list of the names of all files present in a directory in Node.js?
- How do I view events fired on an element in Chrome DevTools?
- CSS transition doesn’t start/callback isn’t called
- Swap rows with columns (transposition) of a matrix in javascript [duplicate]
- Are there any standards for mobile device web browsers in terms of thread sleeping? [closed]
- canvas2d toDataURL() different output on different browser
- How can I check that two objects have the same set of property names?
- How to get old Value with onchange() event in text box
- How change content value of pseudo :before element by Javascript [duplicate]
- I’m getting an error “Tabs cannot be edited right now (user may be dragging a tab)” on tab update/activate/focus event in chrome 91
- webpack require every file in directory
- Three.js cube with different texture on each face
- Error message “DevTools failed to load SourceMap: Could not load content for chrome-extension://…”
- How can I integrate Python and JavaScript?
- What is the difference between BehaviorSubject and Observable?
- Javascript object literal – possible to add duplicate keys?
- Upgrading to Angular 10 – Fix CommonJS or AMD dependencies can cause optimization bailouts
- Unchecked runtime.lastError: Cannot access contents of url “”. Extension manifest must request permission to access this host. In manifest 3