Files
lo/docs/data/core-rejectmap.md
T
Samuel Berthe fa095e4b4f fix(doc): fix go playground demo URL (#832)
* fix(doc): fix go playground demo URL

* fix(doc): add more go playground demo URL
2026-03-06 00:09:59 +01:00

30 lines
643 B
Markdown

---
name: RejectMap
slug: rejectmap
sourceRef: slice.go#L550
category: core
subCategory: slice
playUrl: https://go.dev/play/p/bmXhtuM2OMq
variantHelpers:
- core#slice#rejectmap
similarHelpers:
- core#slice#filtermap
- core#slice#map
- core#slice#filter
- core#slice#reject
position: 270
signatures:
- "func RejectMap[T any, R any](collection []T, callback func(item T, index int) (R, bool)) []R"
---
Opposite of FilterMap: maps each item and includes results where the predicate returned false.
```go
items := lo.RejectMap([]int{1, 2, 3, 4}, func(x int, _ int) (int, bool) {
return x * 10, x%2 == 0
})
// []int{10, 30}
```