Since July 2021 they have added a new error cause property in Javascript, so we are able to do:
throw new Error('New error message', { cause: err });
In Firefox this err object is shown after the original error. On Chrome only the original error is shown, and I can't store the thrown error into variable to inspect it. How do I see the error cause then? (Without modifying the source code / get into the debugger)
Starting in Chrome 125, the developer tools will now automatically display the cause chain: https://developer.chrome.com/blog/new-in-devtools-125#error-cause