Implement a Deep Copy function for objects in JavaScript.
Instruction: Write a function that creates a deep copy of an object, including nested objects.
Context: This question assesses the candidate's ability to work with objects and their understanding of reference vs. value in JavaScript.
Updated
Official answer available
Read the opening below, then unlock the full answer and practical guidance.
For supported data values, I would use structuredClone rather than write a recursive copier that silently loses types or crashes on cycles...