Take¶
func Take[T any](slice []T, n int) []T
Take returns the first n elements from the slice. If n is greater than the slice length, returns the entire slice. If n is zero or negative, returns an empty slice.
func Take[T any](slice []T, n int) []T
Take returns the first n elements from the slice. If n is greater than the slice length, returns the entire slice. If n is zero or negative, returns an empty slice.