I'm trying to extract all properties from an Error instance by doing.
const test = new Error('hi there');
console.log({...test}); // empty object (I expected name + message)
console.log(test.message); // "hi there"
console.log(test.hasOwnProperty("message")); // True
Why is it not possible to destructure the message
property from the Error instance in a new object?