Ask your AI Ask your AI to turn this code into a guided bug-finding exercise.
Claude ChatGPT Copy prompt I am reading "A method is passed directly as a callback and loses its receiver. Which narrow change preserves the original receiver without changing the method body?" on CodeWiki (https://codewiki.com/practice/mcq/javascript/checkpoint-2/checkpoint-2-preserve-receiver/).
Context (verbatim from the page):
"""
A method is passed directly as a callback and loses its receiver. Which narrow change preserves the original receiver without changing the method body?
Pass `controller.handle.bind(controller)`.
Pass `controller.handle.call(controller)` as the callback.
Assign `controller.handle` to a new variable and pass that variable.
"""
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.