Sobes.tech
Junior — Senior

Which array will be printed

livecode

Task condition

Determine which array will be displayed on the screen after executing the program.

package main

// import "fmt"

func sub(arr []int) []int {
    return append(arr, 5, 6)
}

func main() {
    nums := []int{1, 2, 3, 4}
    sub(nums[2:])
    fmt.Println(nums)
}