mirror of
https://github.com/rjNemo/underscore
synced 2026-06-06 02:26:42 +00:00
8 lines
264 B
Go
8 lines
264 B
Go
package underscore
|
|
|
|
// Difference Returns a copy of the array with all instances of the values that are not present in the other array.
|
|
func Difference[T comparable](slice, other []T) []T {
|
|
return Filter(slice, func(n T) bool {
|
|
return !Contains(other, n)
|
|
})
|
|
}
|