Allocating capacity for a new slice

Report a typo

Suppose you have two slices sl1 and sl2 that store float64 numbers:

var sl1 = []float64{3.1416, 1.618, 2.718}
var sl2 = []float64{1.01, 2.02, 3.03, 4.04}

Select from below the code line that would properly initialize a new slice sl3 with the exact capacity cap = 7 required to store the elements of both sl1 and sl2.

Select one option from the list
___

Create a free account to access the full topic