Object spread an Error results in no message property [duplicate]
问题 This question already has an answer here : Why can't I see the keys of an Error object? (1 answer) Closed 5 months ago . I'm trying to spread an Error so that I can alter the error without affecting the original error. const error = new Error('Error test'); const freeError = {...error}; console.log(error, freeError); But the output is an empty object {} . I'm expecting the freeError have at least a message property, but there is none . Is this a part of JavaScript feature or is there