Published
- 1 min read
javascript search dictionary by value
The solution for this is noted below
javascript search dictionary by value
Solution
function getKeyByValue(object, value) {
return Object.keys(object).find((key) => object[key] === value)
}
Try other methods by searching on the site. That is if this doesn’t work