I've a problem getting object keys by value for example:
issues: {
window_expired: 'Yes',
no_power: 'No',
no_display: 'Yes'
}
I want to get object keys which have 'Yes' Value as: window_expired, no_display
I've tried this method which is working but it's returning the 1st key i want to loop through and get the keys by value:
function getKeyByValue(object, value) {
return Object.keys(object).find((key) => object[key] === value);
}