Traverse through map to find the candidate with maximum votes .
let maxValueInMap = 0 ; let winner = " " ; for ( let [ key , value ] of map . entries ( ) ) { let Key = key ; let val = value ; if ( val > maxValueInMap ) { maxValueInMap = val ; winner = key ; }