Skip to content
Make room for learningYour learning studio
Choose const or var4 min

Loading your session…

A small idea, worth understanding

Choose const or var

Use mutable Zig bindings only when values change.

Zig uses const for a binding that will not change and var for one that will. Variables must be initialized.

Zig reports a var that is never mutated so you can express its intent with const.

Two activities. No typing needed. You can always retry, or read an explanation and continue.

Read the full lesson first