I have a Javascript question.
var choices = {
"red": {
number: 1
},
"blue": {
number: 2
},
"black": {
number: 3
},
"green": {
number: 4
},
"white": {
number: 3
}
How can we get the 2 keys of the dict "choices" with the least "number" ?
In this example it would be "red" and "blue". If there is a tie, I would like to have a random one between the tied one.
All my solutions are really ugly so I am asking for help.