var food = {
"fruit":{"brand":{"grgrdgdr":true,"ggyugy":true}, "sold":2},
"vegetable" :{"brand":{"htrhtr":true},"sold": 1},
"snack":{"brand":{"htrhr":true},"sold": 3},
"other":{"brand":{"gdhshd":true},"sold":1},
....
...
...
};
How do I console log the object name that sold the most, in this case should be the word snack.
I find this link, but its structure is not similar to mine. Get object keys with the highest value in Javascript
any help is appreciated thanks in advance