Reading 8: Mutability & Immutability
Recall from Basic TypeScript when we discussed snapshot diagrams that some objects are immutable: once created, they always represent the same value. Other objects are mutable: they have methods that change the value of the object.
Reading 8: Mutability & Immutability > hide Snapdown help Snapdown is a language for drawing snapshot diagrams. Click on the links below to see examples of Snapdown in action! In each example, you'll see a snippet of Snapdown syntax and the corresponding diagram side-by-side. Primitives (click to expand) In this example, we have two variables: i points to the value 5 , and s points to the value "abc" . i -> 5 s -> "abc" Objects (click to expand) In this example, f points to a MyFloat object with the value 5.0 , s points to a MyString object with the value "abc" . f -> (MyFloat 5.0) s -> (MyStr
Explore this link on the map →related reading
- Immutable object - Wikipediaen.wikipedia.org
- Immutability in React: Should you mutate objects? - LogRocket Blogblog.logrocket.com
- Reading 2: Basic TypeScriptweb.mit.edu
- Variables and Mutability - The Rust Programming Languagedoc.rust-lang.org
- References and Borrowing - The Rust Programming Languagedoc.rust-lang.org
- Everything is Fertilenickcammarata.com
- Reading 11: Recursive Data Typesweb.mit.edu
- Reading 5: Designing Specificationsweb.mit.edu
- Updating Arrays in State – Reactreact.dev
- Basic TypeScriptweb.mit.edu
- A half-hour to learn Rustfasterthanli.me
- Reading 17: Recursive Data Typesweb.mit.edu