6. Range
for INDEX, ELEMENT := range SLICE {
}for index, element := range messages {
// you get BOTH the index AND the element
}fruits := []string{"apple", "banana", "grape"}
for i, fruit := range fruits {
fmt.Println(i, fruit)
}
// 0 apple
// 1 banana
// 2 grape