I am not being able to get the String 'ola' from "label" while searching for the "value" 174.
In a similar question I found a piece of code similar from what I have: How to get a key in a JavaScript object by its value? . I tried it, but it returned undefined. Since then I have been changing it to try to return something. Right now as it is it returns a boolean value (false).
a = {
list: {0: {label: 'ola', value: 174}}
};
value = 174;
console.log([Object.values(a.list).includes(value)]);
I would like to return just the String 'ola' by searching for the "value" it has, in this case it is 174. And I would like to keep the structure of the Object "a" as it is.