Sobes.tech
Junior — Senior

How do the length and capacity parameters work in the make function

livecode

Task condition

Determine what output the program will produce when two slices are created in different ways: one with only length, and the other with zero length but specified capacity. What will fmt.Println print?

package main

import "fmt"

func main() {
    a := make([]int, 10)
    b := make([]int, 0, 10)
    fmt.Println(a, b) // ????????
}