Global Feed Post Login
Replying to Avatar 甘林老木

array := [6]int{10, 11, 12 ,13, 14, 15} slice := array[2:4]

the slice output is [12, 13], why not include value 14?

The slice starts from the second element of the array which has value 12."

does element means the table " | "?

|10|11|12|13|14|15|

0 1 2 3 4 5 6

Avatar
甘林老木 3y ago

|10|11|12|13|14|15|

0--1---2---3---4---5---6

Reply to this note

Please Login to reply.

Discussion

No replies yet.