Answers for "how to get a key by value in js object"

4

js find key by value in object

Object.keys(object).find(key => object[key] === value)
Posted by: Guest on December-30-2020
3

getkey by value js

function getKeyByValue(object, value) {
  return Object.keys(object).find(key => object[key] === value);
}
Posted by: Guest on May-12-2021

Code answers related to "how to get a key by value in js object"

Code answers related to "Javascript"

Browse Popular Code Answers by Language