Working with Slices in Go(golang)

In other programming languages like JavaScript, slices are a function that we call that returns a shallow copy of a portion of an array into a new array. In Go, they do very much the same thing, but the syntax is a bit different. It looks just like an array but with some key differences. First off, unlike arrays that are a fixed length, a slice’s length is dynamic so to declare a slice we just leave the area within square brackets…