flâneur — a map of the web's best reading

Reading 8: Mutability & Immutability

web.mit.edu · 8,015 words · saved by 1 readers

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