From time to time you may want to see every call-stack of a specific function for profiling concerns.
Here is a naive approach:
When executed in firebug, only 1 Error is shown. We miss the alert() and the second call from doAnotherThing.
Solution? Prefer console.log instead of throw:
Now our 2 error (with call-stack) appear in Firebug while the alert('ok') pop-out as expected.