0Pricing
Mojo Academy · Lesson

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 = a

All lessons in this course

  1. What Value Semantics Means
  2. Copies vs Shared State
  3. Mojo's Safe Default
  4. A First Look at Mutation
← Back to Mojo Academy