Intermediate JavaScript
Q79 / 100

What is the Error.cause property (ES2022)?

Correct! Well done.

Incorrect.

The correct answer is B) An optional property on Error for linking a new error to the original error, preserving the error chain

B

Correct Answer

An optional property on Error for linking a new error to the original error, preserving the error chain

Explanation

throw new Error("fetch failed", { cause: originalError }) links errors. Access via err.cause, enabling better debugging of wrapped errors.

Progress
79/100