Slices of Slices
A slice of slices builds a grid.
Example
package main
import "fmt"
func main() {
g := [][]int{{1, 2}, {3, 4}}
g = append(g, []int{5, 6})
for _, row := range g {
fmt.Println(row)
}
}Result
[1 2] [3 4] [5 6]
Exercise
Grid type.
[]int
Quiz Test
These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.