Which method deep-clones an object in JS?
-
A
Object.assign()
-
B
JSON.parse/stringify
-
C
_.cloneDeep
-
D
structuredClone()
Correct answer
Correct answer
D. structuredClone()
14 views
Explanation
structuredClone() is native deep copy.
Doubts & discussion
Not sure why the answer is D? Ask here and get an explanation.
Ask a doubt about this MCQ