Can you describe the process of creating a deep clone function in JavaScript, focusing on handling complex data structures and maintaining object references?

Interview question asked to Frontend Engineers interviewing at Amazon, Bethesda Softworks, Unity Technologies and others: Can you describe the process of creating a deep clone function in JavaScript, focusing on handling complex data structures and maintaining object references?.