I have this code:
const func = () => {
throw new Error('hey') + 'boo'
return 'OK'
}
try {
const val = func()
console.log(val)
} catch (error) {
console.log(error)
}
When launched the result is a console line:
"Error: heyboo"
But this is not clear reading the code. What's the reason for this?