Go · Stage 5 – Grouping Data · Lesson 30 of 64

Arrays

Store a fixed-size sequence of values of one type.

Go code

scores := [3]int{10, 20, 30}
fmt.Println(scores)
Line-by-line explanation
  1. [3]int means an array of exactly three integers.
  2. The braces provide the values.
  3. Println displays the full array.
Expected output
[10 20 30]

This is the expected result.