node js find key by value code example
Example 1: getkey by value js
function getKeyByValue(object, value) {
return Object.keys(object).find(key => object[key] === value);
}
Example 2: js find key by value in object
Object.keys(object).find(key => object[key] === value)