Ask your AI Ask your AI to turn this code into a guided bug-finding exercise.
Claude ChatGPT I am reading "An endpoint requires a JSON object with a string orderId. What must happen after JSON.parse succeeds?" on CodeWiki (https://codewiki.com/practice/mcq/javascript/json/parse-before-validation/).
Context (verbatim from the page):
"""
An endpoint requires a JSON object with a string orderId. What must happen after JSON.parse succeeds?
Check that the result is a non-null, non-array object and that orderId is a string.
Nothing; valid JSON syntax guarantees the endpoint shape.
Call JSON.stringify on the parsed value and compare string lengths.
Check only that typeof result is object.
"""
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.