var
Variable definition by explicitly specifying the type.
Syntax
var name type = value
Description
Used when you want to specify the type or at the package level. If no value is given, it takes the zero value (0, "", false).
Example
Loading editor…
Expected output
42 true
When to use?
Variables with explicit types or default values.