There are many questions about this, but none of them solved my problem.
I have this object:
const default_keys = {
l: 1,
t: 5,
o: 10,
r: 50,
w: 100,
y: 500,
m: 1000,
f: 5000,
a: 10000,
z: 50000,
d: 100000,
q: 1000000
};
so, among all these key:value items, I want to know which key has the value = 100 (in this case it should return "w");
is it possible?
EDIT: I tried this solution, but it didn't work because it only works with fixed key names:
const object1 = {
a: {val: "aa"},
b: {val: "bb"},
c: {val: "cc"}
};
let a = Object.values(object1).find((obj) => {
return obj.val == "bb"
});
in this case the fixed name is "val", but in my case there is no fixed name..