I want to reach the higher numbers in an object.
let object1 = {
a: 2,
b: 2,
c: 0,
d: 3,
e: 1,
f: 1
}
// Need to get 2,2,3 above. The first 3 highest ones.
let object2 = {
a: 7,
b: 15,
c: 1,
d: 7,
e: 4,
f: 3
}
// 15,7,7 above.
But it is not like return > 1 because I cannot set an exact number; the object can be
let object1 = {
a: 1,
b: 1,
c: 0,
d: 2,
e: 0,
f: 0
}
I need to compare every single key with others so that I can find the higher numbers(for example the first 3 highest numbers) in the object.
I have tried it like keys.reduce but I could not reach out to a good solution.