In Javascript, suppose I want to perform some cleanup when an exception happens, but let the exception continue to propagate up the stack, eg:
try {
enterAweso
The stack property of an Error object is created at the same time as the Error object itself, not at the point it's thrown. They're often the same because of the idiom
throw new Error("message");
and if you use the code just as you've written it, the stack property will not be changed when you rethrow the error.