Grouping Similar Data: Arrays and Slices

Let’s learn about grouping similar data in the Go language.

Introducing arrays and slices

There are times when we want to keep multiple values of the same data type under a single variable and access them using an index number. The simplest way to do that in Go is by using arrays or slices.

Arrays are the most widely used data structures and can be found in almost all programming languages due to their simplicity and speed of access. Go provides an alternative to arrays that is called a slice.

Get hands-on with 1200+ tech skills courses.