2022-10-27 15:07:13 +00:00
|
|
|
export function mostUsedChar(text) {
|
2022-11-02 19:39:30 +00:00
|
|
|
let max = 0,
|
|
|
|
maxChar = '';
|
|
|
|
text.split('').forEach(function(char){
|
|
|
|
if(text.split(char).length > max) {
|
|
|
|
max = text.split(char).length;
|
|
|
|
maxChar = char;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
return maxChar;
|
|
|
|
}
|