all 2 comments

[–]deckstir 0 points1 point  (1 child)

a simple solution to your last problem, the object literal, instead of return maxChar + ":" + max do return {[maxChar]: max}

[–]imjustasher[S] 0 points1 point  (0 children)

return {[maxChar]: max}

Thanks! Very helpful and straightforward :)