Ask your AI Ask your AI to turn this code into a guided bug-finding exercise.
Claude ChatGPT I am reading "A Map may explicitly store undefined. Which check distinguishes that entry from an absent key?" on CodeWiki (https://codewiki.com/practice/mcq/javascript/map-set/distinguish-missing-from-undefined/).
Context (verbatim from the page):
"""
A Map may explicitly store undefined. Which check distinguishes that entry from an absent key?
Call map.has(key).
Check Boolean(map.get(key)).
Compare map.get(key) with undefined.
Use map.get(key) || undefined.
"""
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.