0Pricing
Mojo Academy · Lesson

Borrowing Arguments Read-Only

The borrowed default for safe reads.

Why Ownership Matters

When you pass a value to a function, Mojo needs to know who can read or change it. That rule is an ownership convention. 🔑

The Default Is Borrowing

By default an argument is borrowed. The function gets read access to the caller's value but does not take it over.

All lessons in this course

  1. Borrowing Arguments Read-Only
  2. Mutating in Place with inout
  3. Taking Ownership with owned
  4. The Transfer Operator
← Back to Mojo Academy