mirror of
https://github.com/samber/lo.git
synced 2026-04-22 15:37:14 +08:00
fa095e4b4f
* fix(doc): fix go playground demo URL * fix(doc): add more go playground demo URL
590 B
590 B
name, slug, sourceRef, category, subCategory, playUrl, variantHelpers, similarHelpers, position, signatures
| name | slug | sourceRef | category | subCategory | playUrl | variantHelpers | similarHelpers | position | signatures | ||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| NthOr | nthor | find.go#L635 | core | find | https://go.dev/play/p/njKcNhBBVsF |
|
|
330 |
|
Returns the element at index nth of collection, or the fallback if out of bounds. If nth is negative, returns the nth element from the end.
v := lo.NthOr([]int{10, 20, 30}, 10, -1)
// v == -1