Ask your AI Ask your AI to turn this code into a guided bug-finding exercise.
Claude ChatGPT I am reading "Why pass a caught failure as the cause option when creating a higher-level Error?" on CodeWiki (https://codewiki.com/practice/mcq/javascript/error-handling/error-cause-purpose/).
Context (verbatim from the page):
"""
Why pass a caught failure as the cause option when creating a higher-level Error?
It preserves the original failure for diagnosis while the new Error adds operation context.
It guarantees that the new Error has the same class as the original.
It automatically retries the failed operation once.
It converts every thrown value into a TypeError.
"""
Introduce three subtle bugs into the example above and let me find them. Reveal each answer only after I have guessed.
Answer in English. Keep code examples in JavaScript. Where you are unsure, say so.