13 lines
335 B
JavaScript
13 lines
335 B
JavaScript
export function mostUsedChar(text) {
|
|
// implementar logica aqui
|
|
let max = 0;
|
|
let mostRep = '';
|
|
text.split('').forEach(function (index) {
|
|
if (text.split(index).length > max ) {
|
|
max = text.split(index).length;
|
|
mostRep = index;
|
|
}
|
|
}
|
|
);
|
|
return mostRep;
|
|
} |