Golang - Array and Slices

Golang - Array and Slices ---------------------------------------------------------------------- So let’s start the video! What are arrays and slices in Go? Arrays are just a slice on steroids. Both of them are homogeneous collections of variables. That means if you have an array/slice you know precisely, what kind of data all the items are stored inside the array/slice, but with an array, you can use them just like any other variable. For example, you have array [int] when you create or change value at index 2, it’s not changing the contents of another index 0 or 1. But with slice thing is changing. Slices and arrays are the same under the hood, and slices have additional functionality. ---------------------------------------------------------------------- Golang - Constants Check more on my website -
Back to Top