TakeLast¶
func TakeLast[T any](slice []T, n int) []T
TakeLast returns the last 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 TakeLast[T any](slice []T, n int) []T
TakeLast returns the last 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.