Title here
Summary here
for
loops on arrays and slices provide both the index and value for each entry. Above we didn’t need the index, so we ignored it. Sometimes we actually want the indexes though.
for
loops on dictionaries iterate over key/value pairs.
for
loops can also iterate over just the keys of a dictionary.
for
loops on strings iterate over Unicode code points. The first value is the starting byte index of the character and the second the character itself.
Running the code above yields: