range on arrays and slices provides both the index and value for each entry. Above we didn’t need the index, so we ignored it with the blank identifier _. Sometimes we actually want the indexes though.
range on map iterates over key/value pairs.
range can also iterate over just the keys of a map.
range on strings iterates over Unicode code points. The first value is the starting byte index of the rune and the second the rune itself.
To run this JavaScript code, you can use node from the command line: