All 35 Bugs /
0/35 Fixed ✓
JavaScriptHard~12 min

JSON.stringify Deep Clone Circular Crash & Date Loss

What's Broken (Symptom)

Using `JSON.parse(JSON.stringify(obj))` throws a `TypeError` on circular references and silently turns `Date` instances into strings.

Expected Behavior

  • • Implement recursive `deepClone(value, seen = new WeakMap())` (or `structuredClone` when safe) preserving `Date` instances and handling circular links.

Debugging Hints (0/2 used)

Try spotting the bug in the editor first. Need a nudge? Reveal Hint 1 anytime.

Root Cause Breakdown

Pass all 2 automated verification checks on the right to unlock the full Root Cause explanation.

Automated Bug Verification

2 Checks Ready
  • Preserves Date instances instead of stringifyingcloned.createdAt instanceof Date is true.
  • Clones circular object references without throwingSelf-referencing object clones safely.
bugfix.js
Live Sandboxed PreviewCtrl + Enter to verify
Console Output0 log(s)
No console output yet. Run Preview or Verify Bug Fix.