Skip to content

Glossary: Go Basics

range

Also written: for range

Used with `for` to loop over every element of a slice or map, giving the index (or key) and the element (or value). With `range 3` it counts from 0.

Where the book teaches it

Related terms

for