I've noticed very interesting behavior in JavaScript.
Look at these two lines and tell me how their behavior will differ:
(() => { throw Error('err'), console.log('ok') })()
(() => { throw Error('err'); console.log('ok') })()
The only difference is that the first line is comma expression, second's not.
But in the first case, "ok" is printed to the console before the error!
How is this possible? Based on the docs, those expressions should be evaluated from left to right. So I would expect the exception to stop evaluation.
Snippets:
(() => { throw Error('err'), console.log('ok') })()
(() => { throw Error('err'); console.log('ok') })()