Table of Contents

Variables

What is it?

A variable is a named storage location in memory that can hold a value that may change.

What is it used for?

Store data such as inputs, configuration, and computed results.

Example

var age int = 18
name := "Phong" // short declaration
const Pi = 3.14 // constant
 
_ = age
_ = name
_ = Pi

Notes

Hard words (English)