Ask your AI Ask your AI to turn this code into a guided bug-finding exercise.
Claude ChatGPT I am reading "Two consumers need independent retry counts. Which design gives each one a separate captured binding?" on CodeWiki (https://codewiki.com/practice/mcq/javascript/closures/factory-call-ownership/).
Context (verbatim from the page):
"""
Two consumers need independent retry counts. Which design gives each one a separate captured binding?
Call the counter factory once for each consumer.
Call the factory once and assign its result to two variable names.
Call the factory once and copy the returned function with object spread.
Store one returned function in two different arrays.
"""
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.