Get Length
Get the size or length of the list.
Examples in
Go
package main
import (
"fmt"
)
func main() {
var a []int
// In Go, the length of a nil slice is 0
fmt.Println(len(a))
a = append(a, 1, 2, 3)
fmt.Println(len(a))
}
Last Run
:
0
3