Files
lo/docs/data/core-findkey.md
T
2025-10-06 17:15:49 +02:00

517 B

name, slug, sourceRef, category, subCategory, playUrl, variantHelpers, similarHelpers, position, signatures
name slug sourceRef category subCategory playUrl variantHelpers similarHelpers position signatures
FindKey findkey find.go#L128 core find https://go.dev/play/p/Bg0w1VDPYXx
core#find#findkey
core#find#findkeyby
core#find#find
core#find#findby
80
func FindKey[K comparable, V comparable](object map[K]V, value V) (K, bool)

Returns the first key whose value equals the provided value.

k, ok := lo.FindKey(map[string]int{"foo":1, "bar":2, "baz":3}, 2)
// "bar", true