Ask your AI Ask your AI to turn this code into a guided bug-finding exercise.
Claude ChatGPT I am reading "After const copy = Object.assign({}, source), what is guaranteed about a nested object at source.settings?" on CodeWiki (https://codewiki.com/practice/mcq/javascript/object-methods/assign-shallow-identity/).
Context (verbatim from the page):
"""
After const copy = Object.assign({}, source), what is guaranteed about a nested object at source.settings?
copy.settings and source.settings refer to the same object unless a later source overwrites the property.
Object.assign recursively clones settings and preserves no shared identity.
Object.assign freezes settings before placing it in copy.
The result depends only on whether source was declared with const.
"""
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.