Run ❯
Get your
own
website
×
Change Orientation
Change Theme, Dark/Light
Go to Spaces
package main import ("fmt") func main() { arr1 := [6]int{10, 11, 12, 13, 14,15} myslice := arr1[2:4] fmt.Printf("myslice = %v\n", myslice) fmt.Printf("length = %d\n", len(myslice)) fmt.Printf("capacity = %d\n", cap(myslice)) }
myslice = [12 13] length = 2 capacity = 4