Back to Lo

Core Difference

docs/data/core-difference.md

1.53.0260 B
Original Source

Returns the difference between two collections. The first slice contains elements absent from list2; the second contains elements absent from list1.

go
left, right := lo.Difference([]int{0, 1, 2, 3, 4, 5}, []int{0, 2, 6})
// []int{1, 3, 4, 5}, []int{6}