$ ./guess_the_languageProblem Solving — fill the blank
Problem Solving — fill the blank · medium · #306

What goes in the blank?

// deep copy that keeps Dates and Maps intact
const copy = ____(state);

Answer: structuredClone (also accepted: structuredClone, globalThis.structuredClone)

structuredClone deep-copies Dates, Maps, Sets and cycles, which a JSON round-trip loses.
Play Problem Solving ▸