Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Get the key for a value in an object
const getKeyByValue = (obj, value) => Object.keys(obj).find(key => obj[key] === value);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.