I have an object like this:
const users = {
adam: {
age: 28,
extraInfo: 'foobar',
},
brad: {
age: 31,
extraInfo: 'foobar',
},
jef: {
age: 12,
extraInfo: 'baarfoo',
},
};
How can I check which object has the highest value of "age" property and get this object to a constant??
I've tried to use Object.keys(), throw data to Array and reduce but in the end, all these methods were not working as I wanted. I've been stuck on this issue for hours right now.