Answers for "golang iterate reverse slice"

Go
0

golang iterate reverse slice

s := []int{5, 4, 3, 2, 1}
for i := len(s)-1; i >= 0; i-- {
   fmt.Println(s[i])
}
Posted by: Guest on August-20-2020

Browse Popular Code Answers by Language