What Value Semantics Means
Each variable owns its own value.
Two Ways to Think About Data
When you copy a value into a new variable, does each one stand alone, or do they secretly share? Value semantics answers that. 🤔
Each Variable Owns Its Value
Under value semantics, every variable holds its very own copy of the data. No two names quietly point at the same thing.
var a = 5
var b = aAll lessons in this course
- What Value Semantics Means
- Copies vs Shared State
- Mojo's Safe Default
- A First Look at Mutation