73
rated 0 times
[
74]
[
1]
/ answers: 1 / hits: 25150
/ 6 Years ago, wed, june 20, 2018, 12:00:00
Is it possible to throw an object using Error
? In the example below the console shows undefined
.
try {
throw Error({foo: 'bar'});
} catch (err) {
console.log(err.message.foo);
}
More From » error-handling