Write a function that accepts a string and returns an Object with two properties(an array of most frequent characters, and their count).
HINT: you have to use the Object.keys() method.
For eg.
"test" =>{
char:['t'],
count:2
}
"string"=>{
char:['s','t','r','i','n','g'],
count:1
}
"giraffe"=>{
char:['f'],
count:2
}
"aeroplane"=>{
char:['a','e'],
count:2
}
CODE TEMPLATE
function maxFreqChar(str){
// write your code here
}
console.log(maxFreqChar("test"));
console.log(maxFreqChar("string"));
console.log(maxFreqChar("aeroplane"));