Entrega do Desafio #1

Merged
anacarolinaduartecavalcante merged 12 commits from feature/10-longestWords into master 2022-10-28 12:14:06 +00:00
Showing only changes of commit ef2c7d7aef - Show all commits

View File

@ -1,4 +1,12 @@
export function mostUsedChar(text) {
// implementar logica aqui
return ""
let max = 0,
maxChar = '';
text.split('').forEach(function(char){
if(text.split(char).length > max) {
max = text.split(char).length;
maxChar = char;
}
});
return maxChar;
}