Loading topic
let and const, work with objects and arrays, and that you have read the previous chapters on references and mutation bugs. A common belief is that const makes data unchangeable. It does not. const locks the variable. It does not loc2 min readObject.assign.2 min readmap, filter, and spread build new arrays from the previous chapter. It covers four methods added in ES2023 that fill a gap those tools leave open.2 min readmap and filter return new arrays. Here you combine those tools to change a value deep inside a data tree without touching the original.2 min readObject.freeze lets the JavaScript engine enforce that choice, so an accidental mut2 min readstructuredClone makes deep copies. Here we look at what those nested updates leave behind in memory, and why that matters.2 min read=== comparison.2 min readimmer package (npm install immer).2 min readObject.freeze, structuredClone, structural sharing, reference equality, Immer, and Immutable.js. Here the question is which one to use for a given job.2 min read