What is the function used to create a new slice by slicing an existing array or slice in Go?

  • append
  • copy
  • make
  • slice
In Go, the function used to create a new slice by slicing an existing array or slice is the slice function. This function takes the original slice/array and specifies a range to create a new slice. make is used to create slices, maps, and channels with a specified length and capacity. append is used to add elements to a slice. copy is used to copy elements from one slice to another.
Add your answer
Loading...

Leave a comment

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