Curriculum Collections Iteration with range exercise 9 · fill-line
Iteration with range
About this theme
for i, v := range collection is the workhorse. Over a slice you get (index, value). Over a map you get (key, value). Over a string you get (byteIndex, rune). Over a channel you get just the value, with no index. Use _ to discard either side.