Loading topic
const b = a, JavaScript does something different depending on what a holds. For a number or a string, you get an independent value. For an object or an array, you get a second name for the same thing. That difference causes most copying bugs, and it is the reason structuredClone3 min readDate, Map and Set. It also assumes you can run code in a browser console or Node.js and that you have seen try/catch. The previous chapter showed that a shallow copy still shares its nested obj2 min readMap, Set and Date. It also builds on the previous chapter, where you made your first deep copy with structuredClone. Here you will learn which kinds of values the structured clone algorithm accepts, an2 min readstructuredClone and which types it supports. You should also understand that object variables hold references, and that === on two objects checks whether they are the same object, not whether they have equal contents.3 min readtry/catch, and that you have already used structuredClone on plain data, Dates, Maps and Sets. Here you will see which values structuredClone refuses to copy and how to handle that refusal in your code.2 min readObject.defineProperty), symbols, and the basic structuredClone call covered earlier. The focus here is what a successful clone quietly leaves behind. Unsupported values make structuredClone throw an error. The losses in th2 min readstructuredClone copies values, which values it rejects, and how to run code in a browser console or Node.js. It covers which runtimes provide structuredClone as a global, how to check for it before you call it, and what to do when it is missing.3 min readstructuredClone makes deep copies and which types it supports, including ArrayBuffer and typed arrays such as Uint8Array. You should also be comfortable with try/catch and running code in Node.js or a browser console.3 min readstructuredClone behaves, including which types it supports, why it throws DataCloneError, and how the transfer option detaches buffers. It also assumes you can run code in Node.js 15+ or a browser console. The IndexedDB example needs a browser.3 min readObject.assign copy, what a JSON round-trip loses, and how structuredClone handles supported types, circular references and DataCloneError. The goal here is to combine tha2 min read