Loading problem…
Implement deepClone for values composed of primitives, arrays, and plain objects.
deepClone
const original = { a: 1, b: { c: 2 } } const cloned = deepClone(original) cloned.b.c = 99 // original.b.c is still 2
const arr = [1, [2, 3], { x: 4 }] const cloned = deepClone(arr) cloned[1][0] = 9 // arr[1][0] is still 2
3 hints available with Pro