In Go, which loop is used to iterate over elements in an array, slice, string, or map?

  • for loop
  • foreach loop
  • range loop
  • while loop
The range loop in Go is used to iterate over elements in an array, slice, string, or map. It provides a concise syntax for iterating over collections and is commonly used in Go for such purposes.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *