underscore/contains.go
Ruidy 2798562b46
Enable Chaining (#6)
* feat: chain filter map reduce simple Type

* docs: chain documentation

Co-authored-by: Ruidy <rnemausat@newstore.com>
2021-12-31 18:21:00 +01:00

11 lines
219 B
Go

package underscore
// Contains returns true if the value is present in the slice
func Contains[T numbers](values []T, value T) bool {
for _, v := range values {
if v == value {
return true
}
}
return false
}