Unlike arrays, slices are _____ in size and values can be appended to them using the append function.

  • Dynamic
  • Fixed
  • Static
  • Unchangeable
Unlike arrays, slices in Go are dynamic in size, which means you can change the length of a slice as needed. You can append values to a slice using the append function, which allocates a new underlying array if necessary to accommodate the new elements. This dynamic behavior and the append function make slices a versatile choice for working with collections of data in Go.
Add your answer
Loading...

Leave a comment

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