I have the object:
var votes = {
"Alex": {president: "Bob"},
"Bob": {president: "Mary"},
"Cindy": {president: "Cindy"},
"Devin": {president: "Louise"},
"Ernest": {president: "Fred"},
"Fred": {president: "Louise"},
"Gail": {president: "Fred"},
"Hermann": {president: "Ivy"},
"Ivy": {president: "Louise"},
"John": {president: "Louise"},
"Kerry": {president: "Fred"},
"Louise": {president: "Nate"},
}
How would I go about counting all the votes for President? Specifically, how can I show that "Louis" had the most votes?
The only thing I have so far is being about to see who voted for who with:
for (i in votes)
{
console.log(votes[i].president);
};