[RECIPE]: Callstack in Javascript
![[RECIPE]: Callstack in Javascript](https://i.imgur.com/o7AOHhO.jpg)
When debugging legacy javascript code you might need to know who called this function. The simple solution for it - using Error Object, which has stack information.
console.log(new Error('Stack Trace').stack)

When debugging legacy javascript code you might need to know who called this function. The simple solution for it - using Error Object, which has stack information.
console.log(new Error('Stack Trace').stack)