1.

What Is Range In Go?

Answer»

The range KEYWORD is used in for loop to iterate over items of an array, SLICE, channel or MAP. With array and slices, it returns the index of the item as integer. With maps, it returns the key of the NEXT key-value pair.

The range keyword is used in for loop to iterate over items of an array, slice, channel or map. With array and slices, it returns the index of the item as integer. With maps, it returns the key of the next key-value pair.



Discussion

No Comment Found